Dave Brolley
2017-06-30 18:59:39 UTC
*** not ready for merge ***
The following changes expand on mgoodwin's initial file I/O layer. The
initial intention is for this abstraction to be used to implement
seamless (de)compression of PCP archives, however, the abstraction
could, in theory, be used for any PCP file for the same purpose, or
other purposes, as appropriate.
Many places in PCP (libpcp and several privileged tools) pass archive
file handles around with no other context. In order to avoid
over-complicating the implementation, all three archive files are now
declared as (__pmFILE *) and will use this I/O layer. Those which are
not immediately to support seamless (de)compression will use the stdio
handler of the abstraction. This change changes pmloglabel(1),
pmlogrewrite(1), pmlogextract(1) and pmlogreduce(1) to use this I/O
layer for all archive-related I/O.
libpcp has not yet been converted. In order to maintain the code in a
compilable and working state, __pmFILE is temporarily declared as
typedef FILE __pmFILE;
Similarly, all of the I/O layer API functions are currently simple pass
throughs to the original stdio and POSIX API functions. Once we have all
of the call sites converted, we can finish the implement a proper stdio
handler for the abstraction and switch __pmFILE back to the definition
initially provided by mgoodwin. From there we can work on implementing
the decompressing handler.
Dave
-------------------------------------------------------------------------------------------------------------
Changes committed to git://git.pcp.io/brolley/pcp decompress
Dave Brolley (2):
pmlogreduce(1): Remove unused _pmLogGet().
Expand on mgoodwin's initial file I/O layer.
qa/pmlogconv/logio.c | 13 +--
qa/pmlogconv/pmlogconv.c | 30 +++----
qa/src/chkputlogresult.c | 9 +-
src/include/pcp/impl.h | 38 +++++----
src/libpcp/src/check-statics | 4 -
src/libpcp/src/exports | 12 +++
src/libpcp/src/io.c | 77 +++++++++++++++++---
src/libpcp/src/io_stdio.c | 3
src/libpcp/src/io_xz.c | 2
src/pmlogextract/logio.c | 13 +--
src/pmlogextract/pmlogextract.c | 56 +++++++-------
src/pmloglabel/pmloglabel.c | 25 +++---
src/pmlogreduce/indom.c | 2
src/pmlogreduce/logio.c | 154
----------------------------------------
src/pmlogreduce/pmlogreduce.c | 10 +-
src/pmlogrewrite/indom.c | 4 -
src/pmlogrewrite/logio.c | 13 +--
src/pmlogrewrite/metric.c | 3
src/pmlogrewrite/pmlogrewrite.c | 60 +++++++--------
src/pmlogrewrite/result.c | 5 -
20 files changed, 235 insertions(+), 298 deletions(-)
Details ...
commit 2322bdf7bd5fd8f852dd2f5a3ee4a4c117713844
Author: Dave Brolley <***@redhat.com>
Date: Fri Jun 30 14:38:15 2017 -0400
Expand on mgoodwin's initial file I/O layer.
Replace more file I/O calls on archive-related files with
__pm* equivalents. The current set of functions in the I/O layer
are:
PCP_CALL extern __pmFILE *__pmFopen(const char *, const char *);
PCP_CALL extern int __pmFseek(__pmFILE *, long, int);
PCP_CALL extern void __pmRewind(__pmFILE *);
PCP_CALL extern long __pmFtell(__pmFILE *);
PCP_CALL extern size_t __pmFread(void *, size_t, size_t, __pmFILE *);
PCP_CALL extern int __pmFflush(__pmFILE *);
PCP_CALL extern int __pmFsync(__pmFILE *);
PCP_CALL extern off_t __pmLseek(__pmFILE *, off_t, int);
PCP_CALL extern int __pmFstat(__pmFILE *, struct stat *);
PCP_CALL extern int __pmFclose(__pmFILE *);
pmloglabel(1), pmlogrewrite(1), pmlogextract(1) and pmlogreduce(1)
now use this API for all archive file I/O.
All three archive files (l_mfp, l_mdfp, l_tifp) are now (__pmFILE *).
__pmFILE is temporarily typedefed as
typedef FILE __pmFILE;
until we can get all of the call sites converted.
commit 4124c71af315715ea04851a94a19c4bf65d53d73
Author: Dave Brolley <***@redhat.com>
Date: Tue Jun 27 12:14:14 2017 -0400
pmlogreduce(1): Remove unused _pmLogGet().
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links:
You receive all messages sent to this group.
View/Reply Online (#16158): https://groups.io/g/pcp/message/16158
View All Messages In Topic (1): https://groups.io/g/pcp/topic/5433430
Mute This Topic: https://groups.io/mt/5433430/174549
New Topic: https://groups.io/g/pcp/post
-=-=-
pcp mailing list
***@groups.io
https://groups.io/g/pcp/messages
-=-=-
Change Your Subscription: https://groups.io/g/pcp/editsub/174549
Group Home: https://groups.io/g/pcp
Contact Group Owner: pcp+***@groups.io
Terms of Service: https://groups.io/static/tos
Unsubscribe: https://groups.io/g/pcp/leave/354206/1187008340/xyzzy
-=-=-=-=-=-=-=-=-=-=-=-
The following changes expand on mgoodwin's initial file I/O layer. The
initial intention is for this abstraction to be used to implement
seamless (de)compression of PCP archives, however, the abstraction
could, in theory, be used for any PCP file for the same purpose, or
other purposes, as appropriate.
Many places in PCP (libpcp and several privileged tools) pass archive
file handles around with no other context. In order to avoid
over-complicating the implementation, all three archive files are now
declared as (__pmFILE *) and will use this I/O layer. Those which are
not immediately to support seamless (de)compression will use the stdio
handler of the abstraction. This change changes pmloglabel(1),
pmlogrewrite(1), pmlogextract(1) and pmlogreduce(1) to use this I/O
layer for all archive-related I/O.
libpcp has not yet been converted. In order to maintain the code in a
compilable and working state, __pmFILE is temporarily declared as
typedef FILE __pmFILE;
Similarly, all of the I/O layer API functions are currently simple pass
throughs to the original stdio and POSIX API functions. Once we have all
of the call sites converted, we can finish the implement a proper stdio
handler for the abstraction and switch __pmFILE back to the definition
initially provided by mgoodwin. From there we can work on implementing
the decompressing handler.
Dave
-------------------------------------------------------------------------------------------------------------
Changes committed to git://git.pcp.io/brolley/pcp decompress
Dave Brolley (2):
pmlogreduce(1): Remove unused _pmLogGet().
Expand on mgoodwin's initial file I/O layer.
qa/pmlogconv/logio.c | 13 +--
qa/pmlogconv/pmlogconv.c | 30 +++----
qa/src/chkputlogresult.c | 9 +-
src/include/pcp/impl.h | 38 +++++----
src/libpcp/src/check-statics | 4 -
src/libpcp/src/exports | 12 +++
src/libpcp/src/io.c | 77 +++++++++++++++++---
src/libpcp/src/io_stdio.c | 3
src/libpcp/src/io_xz.c | 2
src/pmlogextract/logio.c | 13 +--
src/pmlogextract/pmlogextract.c | 56 +++++++-------
src/pmloglabel/pmloglabel.c | 25 +++---
src/pmlogreduce/indom.c | 2
src/pmlogreduce/logio.c | 154
----------------------------------------
src/pmlogreduce/pmlogreduce.c | 10 +-
src/pmlogrewrite/indom.c | 4 -
src/pmlogrewrite/logio.c | 13 +--
src/pmlogrewrite/metric.c | 3
src/pmlogrewrite/pmlogrewrite.c | 60 +++++++--------
src/pmlogrewrite/result.c | 5 -
20 files changed, 235 insertions(+), 298 deletions(-)
Details ...
commit 2322bdf7bd5fd8f852dd2f5a3ee4a4c117713844
Author: Dave Brolley <***@redhat.com>
Date: Fri Jun 30 14:38:15 2017 -0400
Expand on mgoodwin's initial file I/O layer.
Replace more file I/O calls on archive-related files with
__pm* equivalents. The current set of functions in the I/O layer
are:
PCP_CALL extern __pmFILE *__pmFopen(const char *, const char *);
PCP_CALL extern int __pmFseek(__pmFILE *, long, int);
PCP_CALL extern void __pmRewind(__pmFILE *);
PCP_CALL extern long __pmFtell(__pmFILE *);
PCP_CALL extern size_t __pmFread(void *, size_t, size_t, __pmFILE *);
PCP_CALL extern int __pmFflush(__pmFILE *);
PCP_CALL extern int __pmFsync(__pmFILE *);
PCP_CALL extern off_t __pmLseek(__pmFILE *, off_t, int);
PCP_CALL extern int __pmFstat(__pmFILE *, struct stat *);
PCP_CALL extern int __pmFclose(__pmFILE *);
pmloglabel(1), pmlogrewrite(1), pmlogextract(1) and pmlogreduce(1)
now use this API for all archive file I/O.
All three archive files (l_mfp, l_mdfp, l_tifp) are now (__pmFILE *).
__pmFILE is temporarily typedefed as
typedef FILE __pmFILE;
until we can get all of the call sites converted.
commit 4124c71af315715ea04851a94a19c4bf65d53d73
Author: Dave Brolley <***@redhat.com>
Date: Tue Jun 27 12:14:14 2017 -0400
pmlogreduce(1): Remove unused _pmLogGet().
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links:
You receive all messages sent to this group.
View/Reply Online (#16158): https://groups.io/g/pcp/message/16158
View All Messages In Topic (1): https://groups.io/g/pcp/topic/5433430
Mute This Topic: https://groups.io/mt/5433430/174549
New Topic: https://groups.io/g/pcp/post
-=-=-
pcp mailing list
***@groups.io
https://groups.io/g/pcp/messages
-=-=-
Change Your Subscription: https://groups.io/g/pcp/editsub/174549
Group Home: https://groups.io/g/pcp
Contact Group Owner: pcp+***@groups.io
Terms of Service: https://groups.io/static/tos
Unsubscribe: https://groups.io/g/pcp/leave/354206/1187008340/xyzzy
-=-=-=-=-=-=-=-=-=-=-=-