This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 07/10] Add __pthread_set_abort_hook export


On Wed, Jan 16, 2013 at 07:46:28PM +0100, Andi Kleen wrote:
> On Wed, Jan 16, 2013 at 06:42:25PM +0100, Torvald Riegel wrote:
> > On Fri, 2013-01-11 at 23:33 +0100, Andi Kleen wrote:
> > > On Fri, Jan 11, 2013 at 10:23:50PM +0100, Torvald Riegel wrote:
> > > > On Thu, 2013-01-10 at 12:19 -0800, Andi Kleen wrote:
> > > > > From: Andi Kleen <ak@linux.intel.com>
> > > > > 
> > > > > For some debugging scenarios it is useful to catch aborts. Looking
> > > > > at the abort code can be the only way to get information out of a
> > > > > memory transaction.
> > > > 
> > > > If it's purely for debugging purposes through external debugging tools,
> > > > a systemtap probe or something similar might also be sufficient (or
> > > > better).
> > > 
> > > It's not. Out of band monitoring is very different from in-band.
> > 
> > So what's the in-band monitoring use case?
> 
> Transaction aware assert. Out of band monitoring is generally done with
> PMU profilers like perf using PEBS records.
> 
> https://github.com/andikleen/tsx-tools/blob/master/README.txn-assert
> 
> 
> > 
> > And yes, what you implement is the concept of eliding locks using HW
> > help, so I'd use the hardware lock elision name coined for this concept.
> 
> In the context of TSX HLE means XACQUIRE/XRELEASE prefixes. Since these
> are not used in the glibc implementation calling the glibc
> implementation HLE is not appropiate.
> 
> I can rename the hook __pthread_set_elision_abort_hook_np, although
> I personally think that name is too long.

I object to the existence of such a function entirely. It creates
global state where the desired behavior is local. If such a function
were to exist, it should be setting an attribute of the particular
mutex to store the function pointer, not setting a global. However, I
agree with everybody else that external tools, not introspective
interfaces, are the right way to handle something like this.

Rich


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]