EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: generalTime/epicsTimeGetCurrent and casr questions
From: Michael Davidsaver via Tech-talk <[email protected]>
To: "Layne (US), William C" <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Mon, 11 Mar 2019 20:31:23 -0700
Hi Casey,

On 3/8/19 4:18 PM, Layne (US), William C via Tech-talk wrote:
> am trying to narrow down which futex we are spending lots of time in

This got me thinking about how this would be done.  Looking at glibc
I think the first argument of the futex() syscall is the __data.__lock
member of pthread_mutex_t.

https://github.com/bminor/glibc/blob/43b1048ab9418e902aac8c834a7a9a88c501620a/nptl/pthread_mutex_lock.c#L43

If I change epicsMutexOsdShow() in posix/osdThread.c to:

> void epicsMutexOsdShow(struct epicsMutexOSD * pmutex, unsigned int level)
> {
> #if defined(__linux__) && defined(__GLIBC__)
>     /* GLIBC w/ NTPL is passing the &__lock as the first argument (UADDR)
>      * of the futex() syscall.
>      */
>     printf("    pthread uaddr=%p\n", &pmutex->lock.__data.__lock);
> #endif
> }

and apply

https://github.com/epics-base/epics-base/commit/d1149a0ba90096b3aa2890029ed9a430216d96ec

then I think the uaddr value shown below can be matched to futex() calls.
(I couldn't find a quick way to check this)

> epics> epicsMutexShowAll 0 1
> ellCount(&mutexList) 56 ellCount(&freeList) 0
> epicsMutexId 0x55db1e6f90e0 source ..//iocsh/iocsh.cpp line 78
>     pthread uaddr=0x55db1e6f90a0
> ...

Replies:
Re: generalTime/epicsTimeGetCurrent and casr questions William Layne via Tech-talk
References:
generalTime/epicsTimeGetCurrent and casr questions Layne (US), William C via Tech-talk

Navigate by Date:
Prev: Re: I'm looking for a pvacces example to read PVStructure Michael Davidsaver via Tech-talk
Next: AW: generalTime/epicsTimeGetCurrent and casr questions Brands Helge (PSI) via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: generalTime/epicsTimeGetCurrent and casr questions William Layne via Tech-talk
Next: Re: generalTime/epicsTimeGetCurrent and casr questions William Layne via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
ANJ, 12 Mar 2019 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·