Discussion:
[pcp] pcp updates: mpstat fix, kenj merge
Nathan Scott
2017-07-19 07:12:24 UTC
Permalink
Changes committed to git://git.pcp.io/pcp.git master

Ken McDonell (12):
src/include/pcp/impl.h: add PM_IS_LOCKED() and always include
__pmIsLocked() in libpcp
src/libpcp/doc: update mk.cgraph and document planned PMNS locking
and other recent changes
src/pmlogcheck/pass3.c: cosmetic change
src/pmlogger/src/fetch.c: remove extra c_lock unlocks in myFetch
src/pmlogextract/pmlogextract.c: need to hold c_lock a bit longer for
log I/O
libpcp: refactor PMNS locking
qa/check: defer removal of .bad file until the associated test is run
to completion
qa/451 and 998: change filter to accommodate different libpcp
behaviour
qa/src/multithread4.c: add support for -D... command line args
qa/group: update some group membership and some comment editing
libpcp: change pmns_lock from default to ERRORCHECK pthread_mutex
src/libpcp/pmns.c: fix lock inversion

Nathan Scott (3):
build: add gitignore file for generated pcp-mpstat files
pcp-mpstat: gracefully handle the absence of interrupt metrics
libpcp: drop unused code and fields from internal __pmnsTree


qa/451 | 24 +
qa/883 | 12
qa/883.out | 27 +
qa/998 | 31 +
qa/archives/GNUmakefile | 16
qa/archives/pcp-mpstat2.0 |binary
qa/archives/pcp-mpstat2.index |binary
qa/archives/pcp-mpstat2.meta |binary
qa/check | 3
qa/group | 5
qa/src/multithread4.c | 27 +
src/include/pcp/impl.h | 5
src/libpcp/doc/libpcp-locking.odt |binary
src/libpcp/doc/mk.cgraph | 14
src/libpcp/src/check-statics | 41 -
src/libpcp/src/context.c | 40 -
src/libpcp/src/internal.h | 10
src/libpcp/src/lock.c | 294 ++++++++-----
src/libpcp/src/pmns.c | 845
+++++++++++++++++++++++++-------------
src/pcp/mpstat/.gitignore | 1
src/pcp/mpstat/pcp-mpstat.py | 12
src/pmlogcheck/pass3.c | 4
src/pmlogextract/pmlogextract.c | 10
src/pmlogger/src/fetch.c | 4
24 files changed, 928 insertions(+), 497 deletions(-)


commit efbfd7d3494a8789330f17662bf1bffd08a3c852
Author: Nathan Scott <***@redhat.com>
Date: Wed Jul 19 10:51:29 2017 +1000

libpcp: drop unused code and fields from internal __pmnsTree

While investigating an unrelated issue it was discovered that
the "contiguous" and "symbol" fields of struct __pmnsTree are
set but never used anywhere. We only ever pass pointers to
this structure around outside libpcp, hence its safe to drop
these unused fields (and related code).

commit 04355deea42bf3a1a5063ca9c4fe96d84495b008
Author: Nathan Scott <***@redhat.com>
Date: Wed Jul 19 10:45:41 2017 +1000

pcp-mpstat: gracefully handle the absence of interrupt metrics

Noticed that pcp-mpstat fails to run when per-CPU soft and hard
interrupt metrics are missing from the source (archive, although
it will probably affect non x86 hosts as well I suspect).

For the default report case these are not actually used, so this
is quite unfortunate - the tool can still produce correct output
in that case (now does).

Added an archive showing the problem and extended qa/883.

commit 4cb0df02e2fc8f29b43339112119a5e88da5d2c4
Author: Nathan Scott <***@redhat.com>
Date: Wed Jul 19 10:41:54 2017 +1000

build: add gitignore file for generated pcp-mpstat files

commit fa2519113269d2837239ba48aa7bbdfac7a2d1e5
Author: Ken McDonell <***@internode.on.net>
Date: Wed Jul 19 07:12:13 2017 +1000

src/libpcp/pmns.c: fix lock inversion

The recent pmns_lock changes introduced a lock inversion with the
registered mutex ... fix that, because at the time we are exploring
derived metrics we don't need the pmns_lock any more.

This was causing pmmgr to lock up early in its life.

commit 330446ab54bf9bcd33d2883a3331cf9da06a3883
Author: Ken McDonell <***@internode.on.net>
Date: Tue Jul 18 20:24:29 2017 +1000

libpcp: change pmns_lock from default to ERRORCHECK pthread_mutex

commit d94cd45a3724374b30c24d1f99809fc70c9c3bba
Author: Ken McDonell <***@internode.on.net>
Date: Sun Jul 16 07:23:48 2017 +1000

qa/group: update some group membership and some comment editing

commit 7cd417da3c74bab4321968e387d89d66275448ef
Author: Ken McDonell <***@internode.on.net>
Date: Sun Jul 16 07:22:54 2017 +1000

qa/src/multithread4.c: add support for -D... command line args

commit e939ee0f61f3cb71f281e2d79022e490819ff1df
Author: Ken McDonell <***@internode.on.net>
Date: Sun Jul 16 07:19:39 2017 +1000

qa/451 and 998: change filter to accommodate different libpcp behaviour

If libpcp is compiled with -DBUILD_WITH_LOCK_ASSERTS (not the default,
but I use it a lot in testing), then failures in __pmLock() and
__pmUnlock() trip an assert rather than returning an error.

Work around this for some corner cases in these tests.

commit 0f65209dc4ef003fa40d19ab188a78329c92e5a9
Author: Ken McDonell <***@internode.on.net>
Date: Sat Jul 15 20:10:41 2017 +1000

qa/check: defer removal of .bad file until the associated test is run
to completion

commit 716802c8983a998b9c840025bd500d1e3563f8f0
Author: Ken McDonell <***@internode.on.net>
Date: Sat Jul 15 20:06:58 2017 +1000

libpcp: refactor PMNS locking

Avoid the big libpcp lock altogether, but a number of messy issues,
especially associated with libpcp re-entrancy from the pmTraversePMNS()
and pmTraverse_r() interfaces caused some major refactoring.

The new pmns_lock can only be acquired after any context lock is
acquired (there is none for apps using pmLoadNameSpace() outside a
current context), and once the pmns_lock is acquired, no subsequent
context locking is allowed until the pmns_lock is released.

commit 3250dfda7b242501b49bf1cb79826a20d4569f0c
Author: Ken McDonell <***@internode.on.net>
Date: Sat Jul 15 20:06:00 2017 +1000

src/pmlogextract/pmlogextract.c: need to hold c_lock a bit longer for
log I/O

commit 2b18d96fd118f49e6b3c77fb6901977c69a53444
Author: Ken McDonell <***@internode.on.net>
Date: Sat Jul 15 20:04:44 2017 +1000

src/pmlogger/src/fetch.c: remove extra c_lock unlocks in myFetch

commit 9e33f06f04885d0c630c38a1fc44d1e6477f6934
Author: Ken McDonell <***@internode.on.net>
Date: Wed Jul 12 09:35:41 2017 +1000

src/pmlogcheck/pass3.c: cosmetic change

Picked up from Dave's review ... the code makes more sense if we
use the same __pmContext * for the PM_LOCK(), the call to
__pmLogRead_ctx() and the PM_UNLOCK(). The change is cosmetic
because ctxp and l_ctxp are identical at this point in the code.

commit a17681837783d3be5a77e9bc9c767bb44fef5911
Author: Ken McDonell <***@internode.on.net>
Date: Tue Jul 11 06:51:49 2017 +1000

src/libpcp/doc: update mk.cgraph and document planned PMNS locking and
other recent changes

commit 49cf16fddc831c992a38400d1ce0e21ef972a908
Author: Ken McDonell <***@internode.on.net>
Date: Tue Jul 11 06:48:24 2017 +1000

src/include/pcp/impl.h: add PM_IS_LOCKED() and always include
__pmIsLocked() in libpcp

Loading...