From yannick.brosseau at gmail.com Fri Feb 1 06:09:06 2013 From: yannick.brosseau at gmail.com (Yannick Brosseau) Date: Fri, 01 Feb 2013 22:09:06 +1100 Subject: [lttng-dev] [PATCH babeltrace 1/2] Added Python 3.0 or better requirement to the README file In-Reply-To: <1359640251-6133-1-git-send-email-jeremie.galarneau@efficios.com> References: <1359640251-6133-1-git-send-email-jeremie.galarneau@efficios.com> Message-ID: <510BA252.3020604@gmail.com> On 2013-02-01 00:50, J?r?mie Galarneau wrote: > Signed-off-by: J?r?mie Galarneau > --- > README | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/README b/README > index 9df02e7..ce98e24 100644 > --- a/README > +++ b/README > @@ -49,6 +49,8 @@ To compile Babeltrace, you will need: > (Debian/Ubuntu : python-dev) > swig >= 2.0 (optional) > (Debian/Ubuntu : swig2.0) > + python 3.0 or better (optional) > + (Debian/Ubuntu : python3) We really need python 3.0 to run the bindings now? > From jeremie.galarneau at efficios.com Fri Feb 1 08:54:57 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Fri, 1 Feb 2013 13:54:57 +0000 Subject: [lttng-dev] [PATCH babeltrace 1/2] Added Python 3.0 or better requirement to the README file In-Reply-To: <510BA252.3020604@gmail.com> References: <1359640251-6133-1-git-send-email-jeremie.galarneau@efficios.com> <510BA252.3020604@gmail.com> Message-ID: As for as I know, the bindings do work with Python 2.7. However, we have decided to no longer explicitly support older versions of Python in order to make the bindings, along with future developments, easily maintainable. Regards, J?r?mie On Fri, Feb 1, 2013 at 11:09 AM, Yannick Brosseau wrote: > On 2013-02-01 00:50, J?r?mie Galarneau wrote: >> Signed-off-by: J?r?mie Galarneau >> --- >> README | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/README b/README >> index 9df02e7..ce98e24 100644 >> --- a/README >> +++ b/README >> @@ -49,6 +49,8 @@ To compile Babeltrace, you will need: >> (Debian/Ubuntu : python-dev) >> swig >= 2.0 (optional) >> (Debian/Ubuntu : swig2.0) >> + python 3.0 or better (optional) >> + (Debian/Ubuntu : python3) > We really need python 3.0 to run the bindings now? > >> > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev From christian.babeux at efficios.com Fri Feb 1 11:39:09 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Fri, 1 Feb 2013 11:39:09 -0500 Subject: [lttng-dev] LTTng & Google Summer of Code 2013 Message-ID: Hi everyone, After some initial discussion with the LTTng developers, we think it would be a great opportunity for the LTTng project to participate as a mentoring organisation in Google Summer of Code 2013. Apparently, some attempts were made in the past years but the application deadline was missed by a few picoseconds ;). Here are some of the requirements for a mentoring organisation application [1]: " What is the URL for your Ideas page? What is the main development mailing list for your organization? What is the main IRC channel for your organization? Does your organization have an application template you would like to see students use? If so, please provide it now. " One of the *most* important point of this list is to have an idea pages/list ready for the application. Here are some projects ideas that a student or intern could accomplish within the scope of Google Summer of Code: - Continue the Android port of LTTng - Continue the work done on Python bindings for babeltrace/lttng-tools. - Trace probe support in C++ [2]. - A meta-command support in lttng-tools (ex: lttng --trace, see [3]). - Improve the liblttng-ust-libc-wrapper with additionnal libc functions support. - LTTV features. - Implement syscalls on other architectures (maybe not relevant, see [4]) - Hook the trace/debug infrastructure of Wine in UST. - Etc. So I'm asking the community for feedback and ideas to get this application going! Thanks, Christian [1] - https://www.google-melange.com/document/show/gsoc_program/google/gsoc2012/faqs#mentoring_apply [2] - http://bugs.lttng.org/issues/338 [3] - http://bugs.lttng.org/issues/15 [4] - http://bugs.lttng.org/issues/33 From swaroopkumarsarma at yahoo.co.in Mon Feb 4 08:24:57 2013 From: swaroopkumarsarma at yahoo.co.in (kumar sarma) Date: Mon, 4 Feb 2013 21:24:57 +0800 (SGT) Subject: [lttng-dev] lttng requirements Message-ID: <1359984297.48440.YahooMailNeo@web194606.mail.sg3.yahoo.com> Hi, ? I want to use ltt-ng on my 2.6.32.42 kernel, uclibc, mips platform.? Can anyone suggest what are all the requirements for this? ? Regards, Swaroop. -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.marchi at polymtl.ca Wed Feb 6 09:54:34 2013 From: simon.marchi at polymtl.ca (Simon Marchi) Date: Wed, 6 Feb 2013 09:54:34 -0500 Subject: [lttng-dev] [PATCH lttng-modules] Fix check in lttng_strlen_user_inatomic Message-ID: <1360162474-13940-1-git-send-email-simon.marchi@polymtl.ca> __copy_from_user_inatomic returns the number of bytes that could not be copied, not an error code. This fixes the test accordingly. Signed-off-by: Simon Marchi --- probes/lttng-probe-user.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/probes/lttng-probe-user.c b/probes/lttng-probe-user.c index 94ecf2f..a2368b5 100644 --- a/probes/lttng-probe-user.c +++ b/probes/lttng-probe-user.c @@ -41,7 +41,7 @@ long lttng_strlen_user_inatomic(const char *addr) ret = __copy_from_user_inatomic(&v, (__force const char __user *)(addr), sizeof(v)); - if (unlikely(ret == -EFAULT)) + if (unlikely(ret > 0)) break; count++; if (unlikely(!v)) -- 1.7.1 From Daniel.Thibault at drdc-rddc.gc.ca Wed Feb 6 10:48:52 2013 From: Daniel.Thibault at drdc-rddc.gc.ca (Thibault, Daniel) Date: Wed, 6 Feb 2013 15:48:52 +0000 Subject: [lttng-dev] lttng, lttng-sessiond and the tracing group Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD013EB1@VAL-E-02.valcartier.drdc-rddc.gc.ca> The lttng man pages are a little vague as to the relationship between lttng, the lttng-sessiond, and the tracing group. My experiments have shown that a user belonging to the tracing group should more or less be able to issue lttng commands as if they were prefixed with sudo, but that's not quite right, as we'll see. Is there a document outlining the operational concept? First observation A user in the tracing group who issues an lttng command will launch a user lttng-sessiond only if the root lttng-sessiond isn't already running. That user can easily set up both lttng-sessiond daemons by first stopping the root lttng-sessiond, and then issuing a couple of 'lttng list' commands, the first at user level, the second at root level (using sudo). If he then creates a user-level trace, it'll be listed by both 'lttng trace' and 'sudo lttng trace'. A subsequent root-level trace ('sudo lttng create ...') will be listed only by the root daemon. A problem that arises at this point is that both daemons use the same ~/.lttngrc file to track the current session, so since in this scenario the root trace was created last any defaulting at the user level will be erroneous. Specifically: (user belongs to tracing and sudo groups) (~/.lttngrc does not exist) $ sudo stop lttng-sessiond lttng-sessiond stop/waiting $ lttng -vvv list Spawning a session daemon <-- user-level lttng-sessiond DEBUG1: SIGUSR1 caught [in sighandler() at lttng.c:198] DEBUG2: Session name: (null) [in cmd_list() at commands/list.c:720] DEBUG1: LSM cmd type : 13 [in send_session_msg() at lttng-ctl.c:261] DEBUG1: Session count 0 [in list_sessions() at commands/list.c:588] Currently no available tracing session $ sudo lttng -vvv list Spawning a session daemon <-- root-level lttng-sessiond DEBUG1: SIGUSR1 caught [in sighandler() at lttng.c:198] DEBUG2: Session name: (null) [in cmd_list() at commands/list.c:720] DEBUG1: LSM cmd type : 13 [in send_session_msg() at lttng-ctl.c:261] DEBUG1: Session count 0 [in list_sessions() at commands/list.c:588] Currently no available tracing session $ lttng -vvv create userlevel DEBUG3: URI string: file:///home/daniel/lttng-traces/userlevel-20130206-091913 [in uri_parse() at uri.c:253] DEBUG3: URI file destination: /home/daniel/lttng-traces/userlevel-20130206-091913 [in uri_parse() at uri.c:290] DEBUG3: URI dtype: 3, proto: 0, host: , subdir: , ctrl: 0, data: 0 [in uri_parse() at uri.c:467] DEBUG1: LSM cmd type : 8 [in send_session_msg() at lttng-ctl.c:261] Session userlevel created. Traces will be written in /home/daniel/lttng-traces/userlevel-20130206-091913 DEBUG1: Init config session in /home/daniel [in config_init() at conf.c:294] $ sudo lttng -vvv list DEBUG2: Session name: (null) [in cmd_list() at commands/list.c:720] DEBUG1: LSM cmd type : 13 [in send_session_msg() at lttng-ctl.c:261] DEBUG1: Session count 1 [in list_sessions() at commands/list.c:588] Available tracing sessions: 1) userlevel (/home/daniel/lttng-traces/userlevel-20130206-091913) [inactive] Use lttng list for more details $ lttng -vvv list DEBUG2: Session name: (null) [in cmd_list() at commands/list.c:720] DEBUG1: LSM cmd type : 13 [in send_session_msg() at lttng-ctl.c:261] DEBUG1: Session count 1 [in list_sessions() at commands/list.c:588] Available tracing sessions: 1) userlevel (/home/daniel/lttng-traces/userlevel-20130206-091913) [inactive] Use lttng list for more details $ sudo lttng -vvv create rootlevel DEBUG3: URI string: file:///home/daniel/lttng-traces/rootlevel-20130206-091954 [in uri_parse() at uri.c:253] DEBUG3: URI file destination: /home/daniel/lttng-traces/rootlevel-20130206-091954 [in uri_parse() at uri.c:290] DEBUG3: URI dtype: 3, proto: 0, host: , subdir: , ctrl: 0, data: 0 [in uri_parse() at uri.c:467] DEBUG1: LSM cmd type : 8 [in send_session_msg() at lttng-ctl.c:261] Session rootlevel created. Traces will be written in /home/daniel/lttng-traces/rootlevel-20130206-091954 DEBUG1: Init config session in /home/daniel [in config_init() at conf.c:294] $ sudo lttng -vvv list <-- at this point .lttngrc contains 'session=rootlevel' DEBUG2: Session name: (null) [in cmd_list() at commands/list.c:720] DEBUG1: LSM cmd type : 13 [in send_session_msg() at lttng-ctl.c:261] DEBUG1: Session count 2 [in list_sessions() at commands/list.c:588] Available tracing sessions: 1) rootlevel (/home/daniel/lttng-traces/rootlevel-20130206-091954) [inactive] 2) userlevel (/home/daniel/lttng-traces/userlevel-20130206-091913) [inactive] Use lttng list for more details $ lttng -vvv list DEBUG2: Session name: (null) [in cmd_list() at commands/list.c:720] DEBUG1: LSM cmd type : 13 [in send_session_msg() at lttng-ctl.c:261] DEBUG1: Session count 1 [in list_sessions() at commands/list.c:588] Available tracing sessions: 1) userlevel (/home/daniel/lttng-traces/userlevel-20130206-091913) [inactive] Use lttng list for more details $ lttng -vvv list userlevel DEBUG2: Session name: userlevel [in cmd_list() at commands/list.c:720] DEBUG1: LSM cmd type : 13 [in send_session_msg() at lttng-ctl.c:261] DEBUG1: Session count 1 [in list_sessions() at commands/list.c:588] Tracing session userlevel: [inactive] Trace path: /home/daniel/lttng-traces/userlevel-20130206-091913 DEBUG1: LSM cmd type : 11 [in send_session_msg() at lttng-ctl.c:261] $ lttng -vvv list rootlevel DEBUG2: Session name: rootlevel [in cmd_list() at commands/list.c:720] DEBUG1: LSM cmd type : 13 [in send_session_msg() at lttng-ctl.c:261] DEBUG1: Session count 1 [in list_sessions() at commands/list.c:588] Error: Session 'rootlevel' not found Error: Command error DEBUG1: Clean exit [in clean_exit() at lttng.c:169] $ lttng -vvv start <-- you'd expect this to start the userlevel trace DEBUG2: Config file path found: /home/daniel [in get_session_name() at utils.c:50] DEBUG1: Session name found: rootlevel [in get_session_name() at utils.c:51] DEBUG1: Starting tracing for session rootlevel [in start_tracing() at commands/start.c:81] DEBUG1: LSM cmd type : 16 [in send_session_msg() at lttng-ctl.c:261] Error: Permission denied DEBUG1: Clean exit [in clean_exit() at lttng.c:169] At this point the user cannot use 'service lttng-sessiond stop' or 'stop lttng-sessiond' to stop the user-level daemon: his only recourse is the kill command. This is normal, since service and start/stop both deal with System V init and/or Upstart. Of course the above is a little contrived because it's all from a single console, but you could easily have another user running the root-level lttng commands in parallel to an unknowing user. Second observation Contention for ~/.lttngrc can lead to odd behaviour. This can only occur with users in the tracing group, I think (the root lttng-sessiond has no business writing to a non-tracing user's home directory). Witness this: (user belongs to tracing and sudo groups) (~/.lttngrc does not exist) $ sudo lttng -vvv create rootlevel DEBUG3: URI string: file:///home/daniel/lttng-traces/rootlevel-20130205-162212 [in uri_parse() at uri.c:253] DEBUG3: URI file destination: /home/daniel/lttng-traces/rootlevel-20130205-162212 [in uri_parse() at uri.c:290] DEBUG3: URI dtype: 3, proto: 0, host: , subdir: , ctrl: 0, data: 0 [in uri_parse() at uri.c:467] DEBUG1: LSM cmd type : 8 [in send_session_msg() at lttng-ctl.c:261] Session rootlevel created. Traces will be written in /home/daniel/lttng-traces/rootlevel-20130205-164435 DEBUG1: Init config session in /home/daniel [in config_init() at conf.c:294] $ sudo lttng -vvv list <-- At this point ~./.lttngrc is root-owned, contents 'session=rootlevel' DEBUG2: Session name: (null) [in cmd_list() at commands/list.c:720] DEBUG1: LSM cmd type : 13 [in send_session_msg() at lttng-ctl.c:261] DEBUG1: Session count 1 [in list_sessions() at commands/list.c:588] Available tracing sessions: 1) rootlevel (/home/daniel/lttng-traces/rootlevel-20130205-164435) [inactive] Use lttng list for more details $ lttng -vvv list DEBUG2: Session name: (null) [in cmd_list() at commands/list.c:720] DEBUG1: LSM cmd type : 13 [in send_session_msg() at lttng-ctl.c:261] DEBUG1: Session count 0 [in list_sessions() at commands/list.c:588] Currently no available tracing session $ lttng -vvv create rootlevel DEBUG3: URI string: file:///home/daniel/lttng-traces/rootlevel-20130205-164617 [in uri_parse() at uri.c:253] DEBUG3: URI file destination: /home/daniel/lttng-traces/rootlevel-20130205-164617 [in uri_parse() at uri.c:290] DEBUG3: URI dtype: 3, proto: 0, host: , subdir: , ctrl: 0, data: 0 [in uri_parse() at uri.c:467] DEBUG1: LSM cmd type : 8 [in send_session_msg() at lttng-ctl.c:261] Warning: Session rootlevel already exists Error: Session name already exist DEBUG1: Clean exit [in clean_exit() at lttng.c:169] <-- user will be puzzled that a session name can already exist if the list of sessions is empty $ sudo lttng -vvv list DEBUG2: Session name: (null) [in cmd_list() at commands/list.c:720] DEBUG1: LSM cmd type : 13 [in send_session_msg() at lttng-ctl.c:261] DEBUG1: Session count 1 [in list_sessions() at commands/list.c:588] Available tracing sessions: 1) rootlevel (/home/daniel/lttng-traces/rootlevel-20130205-164435) [inactive] Use lttng list for more details $ lttng -vvv list DEBUG2: Session name: (null) [in cmd_list() at commands/list.c:720] DEBUG1: LSM cmd type : 13 [in send_session_msg() at lttng-ctl.c:261] DEBUG1: Session count 0 [in list_sessions() at commands/list.c:588] Currently no available tracing session $ lttng -vvv create userlevel DEBUG3: URI string: file:///home/daniel/lttng-traces/userlevel-20130205-164835 [in uri_parse() at uri.c:253] DEBUG3: URI file destination: /home/daniel/lttng-traces/userlevel-20130205-164835 [in uri_parse() at uri.c:290] DEBUG3: URI dtype: 3, proto: 0, host: , subdir: , ctrl: 0, data: 0 [in uri_parse() at uri.c:467] DEBUG1: LSM cmd type : 8 [in send_session_msg() at lttng-ctl.c:261] Session userlevel created. Traces will be written in /home/daniel/lttng-traces/userlevel-20130205-164835 Error: Unable to create config file <-- user can't access a root-owned .lttngrc Error: Command error DEBUG1: Clean exit [in clean_exit() at lttng.c:169] $ sudo lttng -vvv list DEBUG2: Session name: (null) [in cmd_list() at commands/list.c:720] DEBUG1: LSM cmd type : 13 [in send_session_msg() at lttng-ctl.c:261] DEBUG1: Session count 2 [in list_sessions() at commands/list.c:588] Available tracing sessions: 1) userlevel (/home/daniel/lttng-traces/userlevel-20130205-164835) [inactive] <-- despite the error, the userlevel session is created 2) rootlevel (/home/daniel/lttng-traces/rootlevel-20130205-164435) [inactive] Use lttng list for more details $ lttng -vvv list DEBUG2: Session name: (null) [in cmd_list() at commands/list.c:720] DEBUG1: LSM cmd type : 13 [in send_session_msg() at lttng-ctl.c:261] DEBUG1: Session count 1 [in list_sessions() at commands/list.c:588] Available tracing sessions: 1) userlevel (/home/daniel/lttng-traces/userlevel-20130205-164835) [inactive] Use lttng list for more details <-- .lttngrc is still root-owned, still contains 'session=rootlevel' $ lttng -vvv destroy <-- user expects to destroy the session he just created DEBUG2: Config file path found: /home/daniel [in get_session_name() at utils.c:50] DEBUG1: Session name found: rootlevel [in get_session_name() at utils.c:51] DEBUG1: LSM cmd type : 9 [in send_session_msg() at lttng-ctl.c:261] DEBUG1: Clean exit [in clean_exit() at lttng.c:169] <-- note the lack of feedback, even though the destroy failed completely $ sudo lttng -vvv list DEBUG2: Session name: (null) [in cmd_list() at commands/list.c:720] DEBUG1: LSM cmd type : 13 [in send_session_msg() at lttng-ctl.c:261] DEBUG1: Session count 2 [in list_sessions() at commands/list.c:588] Available tracing sessions: 1) userlevel (/home/daniel/lttng-traces/userlevel-20130205-164835) [inactive] 2) rootlevel (/home/daniel/lttng-traces/rootlevel-20130205-164435) [inactive] Use lttng list for more details $ lttng -vvv list DEBUG2: Session name: (null) [in cmd_list() at commands/list.c:720] DEBUG1: LSM cmd type : 13 [in send_session_msg() at lttng-ctl.c:261] DEBUG1: Session count 1 [in list_sessions() at commands/list.c:588] Available tracing sessions: 1) userlevel (/home/daniel/lttng-traces/userlevel-20130205-164835) [inactive] Use lttng list for more details $ lttng -vvv destroy userlevel DEBUG1: LSM cmd type : 9 [in send_session_msg() at lttng-ctl.c:261] Session userlevel destroyed DEBUG1: Removing /home/daniel/.lttngrc <-- note how user destroyed a root-owned ~./.lttngrc [in config_destroy() at conf.c:151] $ sudo lttng -vvv list DEBUG2: Session name: (null) [in cmd_list() at commands/list.c:720] DEBUG1: LSM cmd type : 13 [in send_session_msg() at lttng-ctl.c:261] DEBUG1: Session count 1 [in list_sessions() at commands/list.c:588] Available tracing sessions: 1) rootlevel (/home/daniel/lttng-traces/rootlevel-20130205-164435) [inactive] Use lttng list for more details $ lttng -vvv list DEBUG2: Session name: (null) [in cmd_list() at commands/list.c:720] DEBUG1: LSM cmd type : 13 [in send_session_msg() at lttng-ctl.c:261] DEBUG1: Session count 0 [in list_sessions() at commands/list.c:588] Currently no available tracing session $ lttng -vvv destroy -a DEBUG1: LSM cmd type : 13 [in send_session_msg() at lttng-ctl.c:261] No session found, nothing to do. $ sudo lttng -vvv destroy -a DEBUG1: LSM cmd type : 13 [in send_session_msg() at lttng-ctl.c:261] DEBUG1: LSM cmd type : 9 [in send_session_msg() at lttng-ctl.c:261] Session rootlevel destroyed Third observation 'lttng set-session' issues an error only if there is no name specified or if the name is too long (or if .lttngrc is root-owned, of course): it'll happily change the contents to whatever the argument is, including non-existent sessions or even illegal session names (containing embedded '/', for example). A too-long session name (246 characters or more) also has the unfortunate side effect of wiping the contents of .lttngrc. You can also end up with sessions which are "sort of created": $ lttng -vvv create 123456781012345678201234567830123456784012345678501234567860123456787012345678801234567890123456710012345671101234567120123456713012345671401234567150123456716012345671701234567180123456719012345672001234567210123456722012345672301234567240123456 DEBUG3: URI string: file:///home/daniel/lttng-traces/123456781012345678201234567830123456784012345678501234567860123456787012345678801234567890123456710012345671101234567120123456713012345671401234567150123456716012345671701234567180123456719012345672001234567210123456722012345672301234567240123456-2013020 [in uri_parse() at uri.c:253] DEBUG3: URI file destination: /home/daniel/lttng-traces/123456781012345678201234567830123456784012345678501234567860123456787012345678801234567890123456710012345671101234567120123456713012345671401234567150123456716012345671701234567180123456719012345672001234567210123456722012345672301234567240123456-2013020 [in uri_parse() at uri.c:290] DEBUG3: URI dtype: 3, proto: 0, host: , subdir: , ctrl: 0, data: 0 [in uri_parse() at uri.c:467] DEBUG1: LSM cmd type : 8 [in send_session_msg() at lttng-ctl.c:261] Session 123456781012345678201234567830123456784012345678501234567860123456787012345678801234567890123456710012345671101234567120123456713012345671401234567150123456716012345671701234567180123456719012345672001234567210123456722012345672301234567240123456 created. Traces will be written in /home/daniel/lttng-traces/123456781012345678201234567830123456784012345678501234567860123456787012345678801234567890123456710012345671101234567120123456713012345671401234567150123456716012345671701234567180123456719012345672001234567210123456722012345672301234567240123456-2013020 Error: Command error DEBUG1: Clean exit [in clean_exit() at lttng.c:169] In this case I created a session with a 246-character name but got an error, and the output directory has an unexpectedly truncated name. A session with a 245-character name will be created without an error but will still have an unexpectedly truncated output path. Odds are this will cause trouble further down the line. NAME_MAX is 255 on my system. Daniel U. Thibault R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) / Defence R&D Canada - Valcartier (DRDC Valcartier) Cyber s?curit? pour les missions essentielles (CME) / Mission Critical Cyber Security (MCCS) Protection des syst?mes et contremesures (PSC) / Systems Protection & Countermeasures (SPC) 2459 route de la Bravoure Qu?bec, QC G3J 1X5 CANADA Vox : (418) 844-4000 x4245 Fax : (418) 844-4538 NAC : 918V QSDJ Gouvernement du Canada / Government of Canada From mathieu.desnoyers at efficios.com Wed Feb 6 11:29:40 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Wed, 6 Feb 2013 11:29:40 -0500 Subject: [lttng-dev] [PATCH lttng-modules] Fix check in lttng_strlen_user_inatomic In-Reply-To: <1360162474-13940-1-git-send-email-simon.marchi@polymtl.ca> References: <1360162474-13940-1-git-send-email-simon.marchi@polymtl.ca> Message-ID: <20130206162939.GA30271@Krystal> * Simon Marchi (simon.marchi at polymtl.ca) wrote: > __copy_from_user_inatomic returns the number of bytes that could not be > copied, not an error code. This fixes the test accordingly. Merged with update (change ret type to unsigned long too) into master, stable-2.1, stable-2.0. Good catch ! Mathieu > > Signed-off-by: Simon Marchi > --- > probes/lttng-probe-user.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/probes/lttng-probe-user.c b/probes/lttng-probe-user.c > index 94ecf2f..a2368b5 100644 > --- a/probes/lttng-probe-user.c > +++ b/probes/lttng-probe-user.c > @@ -41,7 +41,7 @@ long lttng_strlen_user_inatomic(const char *addr) > ret = __copy_from_user_inatomic(&v, > (__force const char __user *)(addr), > sizeof(v)); > - if (unlikely(ret == -EFAULT)) > + if (unlikely(ret > 0)) > break; > count++; > if (unlikely(!v)) > -- > 1.7.1 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From christian.babeux at efficios.com Wed Feb 6 12:52:25 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Wed, 6 Feb 2013 12:52:25 -0500 Subject: [lttng-dev] lttng, lttng-sessiond and the tracing group In-Reply-To: <48CF5AC71E61DB46B70D0F388054EFFD013EB1@VAL-E-02.valcartier.drdc-rddc.gc.ca> References: <48CF5AC71E61DB46B70D0F388054EFFD013EB1@VAL-E-02.valcartier.drdc-rddc.gc.ca> Message-ID: Hi Daniel, > First observation I'm not able to reproduce your first observation on my machine. > [...] > $ sudo lttng -vvv create rootlevel > DEBUG3: URI string: file:///home/daniel/lttng-traces/rootlevel-20130206-091954 [in uri_parse() at uri.c:253] > DEBUG3: URI file destination: /home/daniel/lttng-traces/rootlevel-20130206-091954 [in uri_parse() at uri.c:290] > DEBUG3: URI dtype: 3, proto: 0, host: , subdir: , ctrl: 0, data: 0 [in uri_parse() at uri.c:467] > DEBUG1: LSM cmd type : 8 [in send_session_msg() at lttng-ctl.c:261] > Session rootlevel created. > Traces will be written in /home/daniel/lttng-traces/rootlevel-20130206-091954 > DEBUG1: Init config session in /home/daniel [in config_init() at conf.c:294] This looks wrong. Traces should be written under the /root/lttng-traces. Are you sure this command has effectively been issued has the root user? It looks like it was issued as your normal user hence the "session=rootlevel" in your user ~/.lttngrc. Could you try su'ing to root instead? > Second observation > > Contention for ~/.lttngrc can lead to odd behaviour. This can only occur with users in the tracing group, I think (the root lttng-sessiond has no business writing to a non-tracing user's home directory). Witness this: I'm also not able to reproduce this situation. I'm thinking there might be a slight difference between the sudo and $HOME directory behavior between our two machines... > Third observation > > 'lttng set-session' issues an error only if there is no name specified or if the name is too long (or if .lttngrc is root-owned, of course): it'll happily change the contents to whatever the argument is, including non-existent sessions or even illegal session names (containing embedded '/', for example). Yes this is the expected behavior. From the lttng man-page: " set-session NAME Set current session name Will change the session name in the .lttngrc file. " Verification is done when issuing the "start" command. An invalid or non-existent session will be detected and no tracing will occur. >A too-long session name (246 characters or more) also has the unfortunate side effect of wiping the contents of .lttngrc. Could you file a bug report for this issue here: http://bugs.lttng.org/projects/lttng-tools Thanks, Christian From Daniel.Thibault at drdc-rddc.gc.ca Wed Feb 6 13:27:24 2013 From: Daniel.Thibault at drdc-rddc.gc.ca (Thibault, Daniel) Date: Wed, 6 Feb 2013 18:27:24 +0000 Subject: [lttng-dev] lttng, lttng-sessiond and the tracing group In-Reply-To: References: <48CF5AC71E61DB46B70D0F388054EFFD013EB1@VAL-E-02.valcartier.drdc-rddc.gc.ca> Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD013F1B@VAL-E-02.valcartier.drdc-rddc.gc.ca> -----Message d'origine----- De?: christian.babeux at 0x80.ca [mailto:christian.babeux at 0x80.ca] De la part de Christian Babeux Envoy??: 6 f?vrier 2013 12:52 > > First observation > > I'm not able to reproduce your first observation on my machine. > > > [...] > > $ sudo lttng -vvv create rootlevel > > Session rootlevel created. > > Traces will be written in > > /home/daniel/lttng-traces/rootlevel-20130206-091954 > > This looks wrong. Traces should be written under the /root/lttng-traces. Are you sure this command has effectively been issued has the root user? It looks like it was issued as your normal user hence the "session=rootlevel" in your user ~/.lttngrc. Could you try su'ing to root instead? This may very well be an "Ubuntism". All flavours of Ubuntu use a locked root and force all users to systematically use sudo; the su command won't go anywhere because there is no root password. (It is possible, though strongly discouraged, to unlock and later relock the root account, as explained here: https://help.ubuntu.com/community/RootSudo) The short and sweet of it is that (nearly) all super-user operations under Ubuntu will be conducted by a user (with sudo privileges), not by the root account. Hence the shenanigans I ran into. It sounds like LTTng will have to adjust the way it allocates the root .lttngrc path under Ubuntu systems, so that it uses /root/.lttngrc instead of ~/.lttngrc Daniel U. Thibault R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) / Defence R&D Canada - Valcartier (DRDC Valcartier) Cyber s?curit? pour les missions essentielles (CME) / Mission Critical Cyber Security (MCCS) Protection des syst?mes et contremesures (PSC) / Systems Protection & Countermeasures (SPC) 2459 route de la Bravoure Qu?bec, QC G3J 1X5 CANADA Vox : (418) 844-4000 x4245 Fax : (418) 844-4538 NAC : 918V QSDJ Gouvernement du Canada / Government of Canada From simon.marchi at polymtl.ca Wed Feb 6 14:14:35 2013 From: simon.marchi at polymtl.ca (Simon Marchi) Date: Wed, 6 Feb 2013 14:14:35 -0500 Subject: [lttng-dev] [PATCH lttng-modules v2] Add system calls definitions for the tilegx architecture Message-ID: <1360178075-17364-1-git-send-email-simon.marchi@polymtl.ca> The definitions were extracted using the lttng-syscalls-extractor module. The overrides were added for the system calls that appeared as sys_unknown in the trace (they don't appear in the generated list). New in v2: * Fixed override defines (I understood there is one for the event definition and one for the table entry). * Added ifdefs for __tilegx__. Signed-off-by: Simon Marchi --- .../syscalls/headers/syscalls_integers.h | 6 + .../syscalls/headers/syscalls_pointers.h | 6 + ...-syscalls-2.6.40.38-MDE-4.1.2.149467_integers.h | 971 ++++++++++ ...-2.6.40.38-MDE-4.1.2.149467_integers_override.h | 52 + ...-syscalls-2.6.40.38-MDE-4.1.2.149467_pointers.h | 1872 ++++++++++++++++++++ ...-2.6.40.38-MDE-4.1.2.149467_pointers_override.h | 14 + 6 files changed, 2921 insertions(+), 0 deletions(-) create mode 100644 instrumentation/syscalls/headers/tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_integers.h create mode 100644 instrumentation/syscalls/headers/tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_integers_override.h create mode 100644 instrumentation/syscalls/headers/tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_pointers.h create mode 100644 instrumentation/syscalls/headers/tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_pointers_override.h diff --git a/instrumentation/syscalls/headers/syscalls_integers.h b/instrumentation/syscalls/headers/syscalls_integers.h index 002130a..c14da57 100644 --- a/instrumentation/syscalls/headers/syscalls_integers.h +++ b/instrumentation/syscalls/headers/syscalls_integers.h @@ -9,3 +9,9 @@ #ifdef CONFIG_ARM #include "arm-32-syscalls-2.6.38_integers.h" #endif + +#ifdef CONFIG_TILE +#ifdef __tilegx__ +#include "tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_integers.h" +#endif +#endif diff --git a/instrumentation/syscalls/headers/syscalls_pointers.h b/instrumentation/syscalls/headers/syscalls_pointers.h index 11b4979..a93bd0d 100644 --- a/instrumentation/syscalls/headers/syscalls_pointers.h +++ b/instrumentation/syscalls/headers/syscalls_pointers.h @@ -9,3 +9,9 @@ #ifdef CONFIG_ARM #include "arm-32-syscalls-2.6.38_pointers.h" #endif + +#ifdef CONFIG_TILE +#ifdef __tilegx__ +#include "tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_pointers.h" +#endif +#endif diff --git a/instrumentation/syscalls/headers/tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_integers.h b/instrumentation/syscalls/headers/tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_integers.h new file mode 100644 index 0000000..8703471 --- /dev/null +++ b/instrumentation/syscalls/headers/tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_integers.h @@ -0,0 +1,971 @@ +/* THIS FILE IS AUTO-GENERATED. DO NOT EDIT */ +#ifndef CREATE_SYSCALL_TABLE + +#if !defined(_TRACE_SYSCALLS_INTEGERS_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_SYSCALLS_INTEGERS_H + +#include +#include +#include "tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_integers_override.h" +#include "syscalls_integers_override.h" + +SC_DECLARE_EVENT_CLASS_NOARGS(syscalls_noargs, + TP_STRUCT__entry(), + TP_fast_assign(), + TP_printk() +) +#ifndef OVERRIDE_64_sys_vhangup +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_vhangup) +#endif +#ifndef OVERRIDE_64_sys_sync +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_sync) +#endif +#ifndef OVERRIDE_64_sys_sched_yield +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_sched_yield) +#endif +#ifndef OVERRIDE_64_sys_restart_syscall +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_restart_syscall) +#endif +#ifndef OVERRIDE_64_sys_setsid +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_setsid) +#endif +#ifndef OVERRIDE_64_sys_getpid +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getpid) +#endif +#ifndef OVERRIDE_64_sys_getppid +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getppid) +#endif +#ifndef OVERRIDE_64_sys_getuid +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getuid) +#endif +#ifndef OVERRIDE_64_sys_geteuid +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_geteuid) +#endif +#ifndef OVERRIDE_64_sys_getgid +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getgid) +#endif +#ifndef OVERRIDE_64_sys_getegid +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getegid) +#endif +#ifndef OVERRIDE_64_sys_gettid +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_gettid) +#endif +#ifndef OVERRIDE_64_sys_munlockall +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_munlockall) +#endif +#ifndef OVERRIDE_64_sys_io_destroy +SC_TRACE_EVENT(sys_io_destroy, + TP_PROTO(aio_context_t ctx), + TP_ARGS(ctx), + TP_STRUCT__entry(__field(aio_context_t, ctx)), + TP_fast_assign(tp_assign(ctx, ctx)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_epoll_create1 +SC_TRACE_EVENT(sys_epoll_create1, + TP_PROTO(int flags), + TP_ARGS(flags), + TP_STRUCT__entry(__field(int, flags)), + TP_fast_assign(tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_dup +SC_TRACE_EVENT(sys_dup, + TP_PROTO(unsigned int fildes), + TP_ARGS(fildes), + TP_STRUCT__entry(__field(unsigned int, fildes)), + TP_fast_assign(tp_assign(fildes, fildes)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_inotify_init1 +SC_TRACE_EVENT(sys_inotify_init1, + TP_PROTO(int flags), + TP_ARGS(flags), + TP_STRUCT__entry(__field(int, flags)), + TP_fast_assign(tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_fchdir +SC_TRACE_EVENT(sys_fchdir, + TP_PROTO(unsigned int fd), + TP_ARGS(fd), + TP_STRUCT__entry(__field(unsigned int, fd)), + TP_fast_assign(tp_assign(fd, fd)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_close +SC_TRACE_EVENT(sys_close, + TP_PROTO(unsigned int fd), + TP_ARGS(fd), + TP_STRUCT__entry(__field(unsigned int, fd)), + TP_fast_assign(tp_assign(fd, fd)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_fsync +SC_TRACE_EVENT(sys_fsync, + TP_PROTO(unsigned int fd), + TP_ARGS(fd), + TP_STRUCT__entry(__field(unsigned int, fd)), + TP_fast_assign(tp_assign(fd, fd)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_fdatasync +SC_TRACE_EVENT(sys_fdatasync, + TP_PROTO(unsigned int fd), + TP_ARGS(fd), + TP_STRUCT__entry(__field(unsigned int, fd)), + TP_fast_assign(tp_assign(fd, fd)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_personality +SC_TRACE_EVENT(sys_personality, + TP_PROTO(unsigned int personality), + TP_ARGS(personality), + TP_STRUCT__entry(__field(unsigned int, personality)), + TP_fast_assign(tp_assign(personality, personality)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_exit +SC_TRACE_EVENT(sys_exit, + TP_PROTO(int error_code), + TP_ARGS(error_code), + TP_STRUCT__entry(__field(int, error_code)), + TP_fast_assign(tp_assign(error_code, error_code)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_exit_group +SC_TRACE_EVENT(sys_exit_group, + TP_PROTO(int error_code), + TP_ARGS(error_code), + TP_STRUCT__entry(__field(int, error_code)), + TP_fast_assign(tp_assign(error_code, error_code)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_unshare +SC_TRACE_EVENT(sys_unshare, + TP_PROTO(unsigned long unshare_flags), + TP_ARGS(unshare_flags), + TP_STRUCT__entry(__field(unsigned long, unshare_flags)), + TP_fast_assign(tp_assign(unshare_flags, unshare_flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_timer_getoverrun +SC_TRACE_EVENT(sys_timer_getoverrun, + TP_PROTO(timer_t timer_id), + TP_ARGS(timer_id), + TP_STRUCT__entry(__field(timer_t, timer_id)), + TP_fast_assign(tp_assign(timer_id, timer_id)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_timer_delete +SC_TRACE_EVENT(sys_timer_delete, + TP_PROTO(timer_t timer_id), + TP_ARGS(timer_id), + TP_STRUCT__entry(__field(timer_t, timer_id)), + TP_fast_assign(tp_assign(timer_id, timer_id)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_sched_getscheduler +SC_TRACE_EVENT(sys_sched_getscheduler, + TP_PROTO(pid_t pid), + TP_ARGS(pid), + TP_STRUCT__entry(__field(pid_t, pid)), + TP_fast_assign(tp_assign(pid, pid)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_sched_get_priority_max +SC_TRACE_EVENT(sys_sched_get_priority_max, + TP_PROTO(int policy), + TP_ARGS(policy), + TP_STRUCT__entry(__field(int, policy)), + TP_fast_assign(tp_assign(policy, policy)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_sched_get_priority_min +SC_TRACE_EVENT(sys_sched_get_priority_min, + TP_PROTO(int policy), + TP_ARGS(policy), + TP_STRUCT__entry(__field(int, policy)), + TP_fast_assign(tp_assign(policy, policy)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_setgid +SC_TRACE_EVENT(sys_setgid, + TP_PROTO(gid_t gid), + TP_ARGS(gid), + TP_STRUCT__entry(__field(gid_t, gid)), + TP_fast_assign(tp_assign(gid, gid)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_setuid +SC_TRACE_EVENT(sys_setuid, + TP_PROTO(uid_t uid), + TP_ARGS(uid), + TP_STRUCT__entry(__field(uid_t, uid)), + TP_fast_assign(tp_assign(uid, uid)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_setfsuid +SC_TRACE_EVENT(sys_setfsuid, + TP_PROTO(uid_t uid), + TP_ARGS(uid), + TP_STRUCT__entry(__field(uid_t, uid)), + TP_fast_assign(tp_assign(uid, uid)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_setfsgid +SC_TRACE_EVENT(sys_setfsgid, + TP_PROTO(gid_t gid), + TP_ARGS(gid), + TP_STRUCT__entry(__field(gid_t, gid)), + TP_fast_assign(tp_assign(gid, gid)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_getpgid +SC_TRACE_EVENT(sys_getpgid, + TP_PROTO(pid_t pid), + TP_ARGS(pid), + TP_STRUCT__entry(__field(pid_t, pid)), + TP_fast_assign(tp_assign(pid, pid)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_getsid +SC_TRACE_EVENT(sys_getsid, + TP_PROTO(pid_t pid), + TP_ARGS(pid), + TP_STRUCT__entry(__field(pid_t, pid)), + TP_fast_assign(tp_assign(pid, pid)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_umask +SC_TRACE_EVENT(sys_umask, + TP_PROTO(int mask), + TP_ARGS(mask), + TP_STRUCT__entry(__field(int, mask)), + TP_fast_assign(tp_assign(mask, mask)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_brk +SC_TRACE_EVENT(sys_brk, + TP_PROTO(unsigned long brk), + TP_ARGS(brk), + TP_STRUCT__entry(__field(unsigned long, brk)), + TP_fast_assign(tp_assign(brk, brk)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_mlockall +SC_TRACE_EVENT(sys_mlockall, + TP_PROTO(int flags), + TP_ARGS(flags), + TP_STRUCT__entry(__field(int, flags)), + TP_fast_assign(tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_set_dataplane +SC_TRACE_EVENT(sys_set_dataplane, + TP_PROTO(int flags), + TP_ARGS(flags), + TP_STRUCT__entry(__field(int, flags)), + TP_fast_assign(tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_syncfs +SC_TRACE_EVENT(sys_syncfs, + TP_PROTO(int fd), + TP_ARGS(fd), + TP_STRUCT__entry(__field(int, fd)), + TP_fast_assign(tp_assign(fd, fd)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_eventfd2 +SC_TRACE_EVENT(sys_eventfd2, + TP_PROTO(unsigned int count, int flags), + TP_ARGS(count, flags), + TP_STRUCT__entry(__field(unsigned int, count) __field(int, flags)), + TP_fast_assign(tp_assign(count, count) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_inotify_rm_watch +SC_TRACE_EVENT(sys_inotify_rm_watch, + TP_PROTO(int fd, __s32 wd), + TP_ARGS(fd, wd), + TP_STRUCT__entry(__field(int, fd) __field(__s32, wd)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(wd, wd)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_ioprio_get +SC_TRACE_EVENT(sys_ioprio_get, + TP_PROTO(int which, int who), + TP_ARGS(which, who), + TP_STRUCT__entry(__field(int, which) __field(int, who)), + TP_fast_assign(tp_assign(which, which) tp_assign(who, who)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_flock +SC_TRACE_EVENT(sys_flock, + TP_PROTO(unsigned int fd, unsigned int cmd), + TP_ARGS(fd, cmd), + TP_STRUCT__entry(__field(unsigned int, fd) __field(unsigned int, cmd)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(cmd, cmd)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_ftruncate +SC_TRACE_EVENT(sys_ftruncate, + TP_PROTO(unsigned int fd, unsigned long length), + TP_ARGS(fd, length), + TP_STRUCT__entry(__field(unsigned int, fd) __field(unsigned long, length)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(length, length)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_fchmod +SC_TRACE_EVENT(sys_fchmod, + TP_PROTO(unsigned int fd, mode_t mode), + TP_ARGS(fd, mode), + TP_STRUCT__entry(__field(unsigned int, fd) __field(mode_t, mode)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(mode, mode)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_timerfd_create +SC_TRACE_EVENT(sys_timerfd_create, + TP_PROTO(int clockid, int flags), + TP_ARGS(clockid, flags), + TP_STRUCT__entry(__field(int, clockid) __field(int, flags)), + TP_fast_assign(tp_assign(clockid, clockid) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_kill +SC_TRACE_EVENT(sys_kill, + TP_PROTO(pid_t pid, int sig), + TP_ARGS(pid, sig), + TP_STRUCT__entry(__field(pid_t, pid) __field(int, sig)), + TP_fast_assign(tp_assign(pid, pid) tp_assign(sig, sig)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_tkill +SC_TRACE_EVENT(sys_tkill, + TP_PROTO(pid_t pid, int sig), + TP_ARGS(pid, sig), + TP_STRUCT__entry(__field(pid_t, pid) __field(int, sig)), + TP_fast_assign(tp_assign(pid, pid) tp_assign(sig, sig)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_getpriority +SC_TRACE_EVENT(sys_getpriority, + TP_PROTO(int which, int who), + TP_ARGS(which, who), + TP_STRUCT__entry(__field(int, which) __field(int, who)), + TP_fast_assign(tp_assign(which, which) tp_assign(who, who)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_setregid +SC_TRACE_EVENT(sys_setregid, + TP_PROTO(gid_t rgid, gid_t egid), + TP_ARGS(rgid, egid), + TP_STRUCT__entry(__field(gid_t, rgid) __field(gid_t, egid)), + TP_fast_assign(tp_assign(rgid, rgid) tp_assign(egid, egid)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_setreuid +SC_TRACE_EVENT(sys_setreuid, + TP_PROTO(uid_t ruid, uid_t euid), + TP_ARGS(ruid, euid), + TP_STRUCT__entry(__field(uid_t, ruid) __field(uid_t, euid)), + TP_fast_assign(tp_assign(ruid, ruid) tp_assign(euid, euid)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_setpgid +SC_TRACE_EVENT(sys_setpgid, + TP_PROTO(pid_t pid, pid_t pgid), + TP_ARGS(pid, pgid), + TP_STRUCT__entry(__field(pid_t, pid) __field(pid_t, pgid)), + TP_fast_assign(tp_assign(pid, pid) tp_assign(pgid, pgid)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_msgget +SC_TRACE_EVENT(sys_msgget, + TP_PROTO(key_t key, int msgflg), + TP_ARGS(key, msgflg), + TP_STRUCT__entry(__field(key_t, key) __field(int, msgflg)), + TP_fast_assign(tp_assign(key, key) tp_assign(msgflg, msgflg)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_listen +SC_TRACE_EVENT(sys_listen, + TP_PROTO(int fd, int backlog), + TP_ARGS(fd, backlog), + TP_STRUCT__entry(__field(int, fd) __field(int, backlog)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(backlog, backlog)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_shutdown +SC_TRACE_EVENT(sys_shutdown, + TP_PROTO(int fd, int how), + TP_ARGS(fd, how), + TP_STRUCT__entry(__field(int, fd) __field(int, how)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(how, how)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_munmap +SC_TRACE_EVENT(sys_munmap, + TP_PROTO(unsigned long addr, size_t len), + TP_ARGS(addr, len), + TP_STRUCT__entry(__field_hex(unsigned long, addr) __field(size_t, len)), + TP_fast_assign(tp_assign(addr, addr) tp_assign(len, len)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_mlock +SC_TRACE_EVENT(sys_mlock, + TP_PROTO(unsigned long start, size_t len), + TP_ARGS(start, len), + TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len)), + TP_fast_assign(tp_assign(start, start) tp_assign(len, len)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_munlock +SC_TRACE_EVENT(sys_munlock, + TP_PROTO(unsigned long start, size_t len), + TP_ARGS(start, len), + TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len)), + TP_fast_assign(tp_assign(start, start) tp_assign(len, len)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_setns +SC_TRACE_EVENT(sys_setns, + TP_PROTO(int fd, int nstype), + TP_ARGS(fd, nstype), + TP_STRUCT__entry(__field(int, fd) __field(int, nstype)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(nstype, nstype)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_dup3 +SC_TRACE_EVENT(sys_dup3, + TP_PROTO(unsigned int oldfd, unsigned int newfd, int flags), + TP_ARGS(oldfd, newfd, flags), + TP_STRUCT__entry(__field(unsigned int, oldfd) __field(unsigned int, newfd) __field(int, flags)), + TP_fast_assign(tp_assign(oldfd, oldfd) tp_assign(newfd, newfd) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_fcntl +SC_TRACE_EVENT(sys_fcntl, + TP_PROTO(unsigned int fd, unsigned int cmd, unsigned long arg), + TP_ARGS(fd, cmd, arg), + TP_STRUCT__entry(__field(unsigned int, fd) __field(unsigned int, cmd) __field(unsigned long, arg)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(cmd, cmd) tp_assign(arg, arg)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_ioctl +SC_TRACE_EVENT(sys_ioctl, + TP_PROTO(unsigned int fd, unsigned int cmd, unsigned long arg), + TP_ARGS(fd, cmd, arg), + TP_STRUCT__entry(__field(unsigned int, fd) __field(unsigned int, cmd) __field(unsigned long, arg)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(cmd, cmd) tp_assign(arg, arg)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_ioprio_set +SC_TRACE_EVENT(sys_ioprio_set, + TP_PROTO(int which, int who, int ioprio), + TP_ARGS(which, who, ioprio), + TP_STRUCT__entry(__field(int, which) __field(int, who) __field(int, ioprio)), + TP_fast_assign(tp_assign(which, which) tp_assign(who, who) tp_assign(ioprio, ioprio)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_fchown +SC_TRACE_EVENT(sys_fchown, + TP_PROTO(unsigned int fd, uid_t user, gid_t group), + TP_ARGS(fd, user, group), + TP_STRUCT__entry(__field(unsigned int, fd) __field(uid_t, user) __field(gid_t, group)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(user, user) tp_assign(group, group)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_lseek +SC_TRACE_EVENT(sys_lseek, + TP_PROTO(unsigned int fd, off_t offset, unsigned int origin), + TP_ARGS(fd, offset, origin), + TP_STRUCT__entry(__field(unsigned int, fd) __field(off_t, offset) __field(unsigned int, origin)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(offset, offset) tp_assign(origin, origin)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_tgkill +SC_TRACE_EVENT(sys_tgkill, + TP_PROTO(pid_t tgid, pid_t pid, int sig), + TP_ARGS(tgid, pid, sig), + TP_STRUCT__entry(__field(pid_t, tgid) __field(pid_t, pid) __field(int, sig)), + TP_fast_assign(tp_assign(tgid, tgid) tp_assign(pid, pid) tp_assign(sig, sig)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_setpriority +SC_TRACE_EVENT(sys_setpriority, + TP_PROTO(int which, int who, int niceval), + TP_ARGS(which, who, niceval), + TP_STRUCT__entry(__field(int, which) __field(int, who) __field(int, niceval)), + TP_fast_assign(tp_assign(which, which) tp_assign(who, who) tp_assign(niceval, niceval)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_setresuid +SC_TRACE_EVENT(sys_setresuid, + TP_PROTO(uid_t ruid, uid_t euid, uid_t suid), + TP_ARGS(ruid, euid, suid), + TP_STRUCT__entry(__field(uid_t, ruid) __field(uid_t, euid) __field(uid_t, suid)), + TP_fast_assign(tp_assign(ruid, ruid) tp_assign(euid, euid) tp_assign(suid, suid)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_setresgid +SC_TRACE_EVENT(sys_setresgid, + TP_PROTO(gid_t rgid, gid_t egid, gid_t sgid), + TP_ARGS(rgid, egid, sgid), + TP_STRUCT__entry(__field(gid_t, rgid) __field(gid_t, egid) __field(gid_t, sgid)), + TP_fast_assign(tp_assign(rgid, rgid) tp_assign(egid, egid) tp_assign(sgid, sgid)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_semget +SC_TRACE_EVENT(sys_semget, + TP_PROTO(key_t key, int nsems, int semflg), + TP_ARGS(key, nsems, semflg), + TP_STRUCT__entry(__field(key_t, key) __field(int, nsems) __field(int, semflg)), + TP_fast_assign(tp_assign(key, key) tp_assign(nsems, nsems) tp_assign(semflg, semflg)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_shmget +SC_TRACE_EVENT(sys_shmget, + TP_PROTO(key_t key, size_t size, int shmflg), + TP_ARGS(key, size, shmflg), + TP_STRUCT__entry(__field(key_t, key) __field(size_t, size) __field(int, shmflg)), + TP_fast_assign(tp_assign(key, key) tp_assign(size, size) tp_assign(shmflg, shmflg)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_socket +SC_TRACE_EVENT(sys_socket, + TP_PROTO(int family, int type, int protocol), + TP_ARGS(family, type, protocol), + TP_STRUCT__entry(__field(int, family) __field(int, type) __field(int, protocol)), + TP_fast_assign(tp_assign(family, family) tp_assign(type, type) tp_assign(protocol, protocol)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_mprotect +SC_TRACE_EVENT(sys_mprotect, + TP_PROTO(unsigned long start, size_t len, unsigned long prot), + TP_ARGS(start, len, prot), + TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len) __field(unsigned long, prot)), + TP_fast_assign(tp_assign(start, start) tp_assign(len, len) tp_assign(prot, prot)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_msync +SC_TRACE_EVENT(sys_msync, + TP_PROTO(unsigned long start, size_t len, int flags), + TP_ARGS(start, len, flags), + TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len) __field(int, flags)), + TP_fast_assign(tp_assign(start, start) tp_assign(len, len) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_madvise +SC_TRACE_EVENT(sys_madvise, + TP_PROTO(unsigned long start, size_t len_in, int behavior), + TP_ARGS(start, len_in, behavior), + TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len_in) __field(int, behavior)), + TP_fast_assign(tp_assign(start, start) tp_assign(len_in, len_in) tp_assign(behavior, behavior)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_cacheflush +SC_TRACE_EVENT(sys_cacheflush, + TP_PROTO(unsigned long addr, unsigned long len, unsigned long flags), + TP_ARGS(addr, len, flags), + TP_STRUCT__entry(__field_hex(unsigned long, addr) __field(unsigned long, len) __field(unsigned long, flags)), + TP_fast_assign(tp_assign(addr, addr) tp_assign(len, len) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_tee +SC_TRACE_EVENT(sys_tee, + TP_PROTO(int fdin, int fdout, size_t len, unsigned int flags), + TP_ARGS(fdin, fdout, len, flags), + TP_STRUCT__entry(__field(int, fdin) __field(int, fdout) __field(size_t, len) __field(unsigned int, flags)), + TP_fast_assign(tp_assign(fdin, fdin) tp_assign(fdout, fdout) tp_assign(len, len) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_ptrace +SC_TRACE_EVENT(sys_ptrace, + TP_PROTO(long request, long pid, unsigned long addr, unsigned long data), + TP_ARGS(request, pid, addr, data), + TP_STRUCT__entry(__field(long, request) __field(long, pid) __field_hex(unsigned long, addr) __field(unsigned long, data)), + TP_fast_assign(tp_assign(request, request) tp_assign(pid, pid) tp_assign(addr, addr) tp_assign(data, data)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_prctl +SC_TRACE_EVENT(sys_prctl, + TP_PROTO(int option, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5), + TP_ARGS(option, arg2, arg3, arg4, arg5), + TP_STRUCT__entry(__field(int, option) __field(unsigned long, arg2) __field(unsigned long, arg3) __field(unsigned long, arg4) __field(unsigned long, arg5)), + TP_fast_assign(tp_assign(option, option) tp_assign(arg2, arg2) tp_assign(arg3, arg3) tp_assign(arg4, arg4) tp_assign(arg5, arg5)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_mremap +SC_TRACE_EVENT(sys_mremap, + TP_PROTO(unsigned long addr, unsigned long old_len, unsigned long new_len, unsigned long flags, unsigned long new_addr), + TP_ARGS(addr, old_len, new_len, flags, new_addr), + TP_STRUCT__entry(__field_hex(unsigned long, addr) __field(unsigned long, old_len) __field(unsigned long, new_len) __field(unsigned long, flags) __field_hex(unsigned long, new_addr)), + TP_fast_assign(tp_assign(addr, addr) tp_assign(old_len, old_len) tp_assign(new_len, new_len) tp_assign(flags, flags) tp_assign(new_addr, new_addr)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_keyctl +SC_TRACE_EVENT(sys_keyctl, + TP_PROTO(int option, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5), + TP_ARGS(option, arg2, arg3, arg4, arg5), + TP_STRUCT__entry(__field(int, option) __field(unsigned long, arg2) __field(unsigned long, arg3) __field(unsigned long, arg4) __field(unsigned long, arg5)), + TP_fast_assign(tp_assign(option, option) tp_assign(arg2, arg2) tp_assign(arg3, arg3) tp_assign(arg4, arg4) tp_assign(arg5, arg5)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_remap_file_pages +SC_TRACE_EVENT(sys_remap_file_pages, + TP_PROTO(unsigned long start, unsigned long size, unsigned long prot, unsigned long pgoff, unsigned long flags), + TP_ARGS(start, size, prot, pgoff, flags), + TP_STRUCT__entry(__field(unsigned long, start) __field(unsigned long, size) __field(unsigned long, prot) __field(unsigned long, pgoff) __field(unsigned long, flags)), + TP_fast_assign(tp_assign(start, start) tp_assign(size, size) tp_assign(prot, prot) tp_assign(pgoff, pgoff) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_mmap +SC_TRACE_EVENT(sys_mmap, + TP_PROTO(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, unsigned long fd, off_t offset), + TP_ARGS(addr, len, prot, flags, fd, offset), + TP_STRUCT__entry(__field_hex(unsigned long, addr) __field(unsigned long, len) __field(unsigned long, prot) __field(unsigned long, flags) __field(unsigned long, fd) __field(off_t, offset)), + TP_fast_assign(tp_assign(addr, addr) tp_assign(len, len) tp_assign(prot, prot) tp_assign(flags, flags) tp_assign(fd, fd) tp_assign(offset, offset)), + TP_printk() +) +#endif + +#endif /* _TRACE_SYSCALLS_INTEGERS_H */ + +/* This part must be outside protection */ +#include "../../../probes/define_trace.h" + +#else /* CREATE_SYSCALL_TABLE */ + +#include "tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_integers_override.h" +#include "syscalls_integers_override.h" + +#ifndef OVERRIDE_TABLE_64_sys_vhangup +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_vhangup, 58, 0) +#endif +#ifndef OVERRIDE_TABLE_64_sys_sync +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_sync, 81, 0) +#endif +#ifndef OVERRIDE_TABLE_64_sys_sched_yield +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_sched_yield, 124, 0) +#endif +#ifndef OVERRIDE_TABLE_64_sys_restart_syscall +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_restart_syscall, 128, 0) +#endif +#ifndef OVERRIDE_TABLE_64_sys_setsid +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_setsid, 157, 0) +#endif +#ifndef OVERRIDE_TABLE_64_sys_getpid +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getpid, 172, 0) +#endif +#ifndef OVERRIDE_TABLE_64_sys_getppid +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getppid, 173, 0) +#endif +#ifndef OVERRIDE_TABLE_64_sys_getuid +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getuid, 174, 0) +#endif +#ifndef OVERRIDE_TABLE_64_sys_geteuid +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_geteuid, 175, 0) +#endif +#ifndef OVERRIDE_TABLE_64_sys_getgid +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getgid, 176, 0) +#endif +#ifndef OVERRIDE_TABLE_64_sys_getegid +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getegid, 177, 0) +#endif +#ifndef OVERRIDE_TABLE_64_sys_gettid +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_gettid, 178, 0) +#endif +#ifndef OVERRIDE_TABLE_64_sys_munlockall +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_munlockall, 231, 0) +#endif +#ifndef OVERRIDE_TABLE_64_sys_io_destroy +TRACE_SYSCALL_TABLE(sys_io_destroy, sys_io_destroy, 1, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_eventfd2 +TRACE_SYSCALL_TABLE(sys_eventfd2, sys_eventfd2, 19, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_epoll_create1 +TRACE_SYSCALL_TABLE(sys_epoll_create1, sys_epoll_create1, 20, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_dup +TRACE_SYSCALL_TABLE(sys_dup, sys_dup, 23, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_dup3 +TRACE_SYSCALL_TABLE(sys_dup3, sys_dup3, 24, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_fcntl +TRACE_SYSCALL_TABLE(sys_fcntl, sys_fcntl, 25, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_inotify_init1 +TRACE_SYSCALL_TABLE(sys_inotify_init1, sys_inotify_init1, 26, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_inotify_rm_watch +TRACE_SYSCALL_TABLE(sys_inotify_rm_watch, sys_inotify_rm_watch, 28, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_ioctl +TRACE_SYSCALL_TABLE(sys_ioctl, sys_ioctl, 29, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_ioprio_set +TRACE_SYSCALL_TABLE(sys_ioprio_set, sys_ioprio_set, 30, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_ioprio_get +TRACE_SYSCALL_TABLE(sys_ioprio_get, sys_ioprio_get, 31, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_flock +TRACE_SYSCALL_TABLE(sys_flock, sys_flock, 32, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_ftruncate +TRACE_SYSCALL_TABLE(sys_ftruncate, sys_ftruncate, 46, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_fchdir +TRACE_SYSCALL_TABLE(sys_fchdir, sys_fchdir, 50, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_fchmod +TRACE_SYSCALL_TABLE(sys_fchmod, sys_fchmod, 52, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_fchown +TRACE_SYSCALL_TABLE(sys_fchown, sys_fchown, 55, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_close +TRACE_SYSCALL_TABLE(sys_close, sys_close, 57, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_lseek +TRACE_SYSCALL_TABLE(sys_lseek, sys_lseek, 62, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_tee +TRACE_SYSCALL_TABLE(sys_tee, sys_tee, 77, 4) +#endif +#ifndef OVERRIDE_TABLE_64_sys_fsync +TRACE_SYSCALL_TABLE(sys_fsync, sys_fsync, 82, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_fdatasync +TRACE_SYSCALL_TABLE(sys_fdatasync, sys_fdatasync, 83, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_timerfd_create +TRACE_SYSCALL_TABLE(sys_timerfd_create, sys_timerfd_create, 85, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_personality +TRACE_SYSCALL_TABLE(sys_personality, sys_personality, 92, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_exit +TRACE_SYSCALL_TABLE(sys_exit, sys_exit, 93, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_exit_group +TRACE_SYSCALL_TABLE(sys_exit_group, sys_exit_group, 94, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_unshare +TRACE_SYSCALL_TABLE(sys_unshare, sys_unshare, 97, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_timer_getoverrun +TRACE_SYSCALL_TABLE(sys_timer_getoverrun, sys_timer_getoverrun, 109, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_timer_delete +TRACE_SYSCALL_TABLE(sys_timer_delete, sys_timer_delete, 111, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_ptrace +TRACE_SYSCALL_TABLE(sys_ptrace, sys_ptrace, 117, 4) +#endif +#ifndef OVERRIDE_TABLE_64_sys_sched_getscheduler +TRACE_SYSCALL_TABLE(sys_sched_getscheduler, sys_sched_getscheduler, 120, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_sched_get_priority_max +TRACE_SYSCALL_TABLE(sys_sched_get_priority_max, sys_sched_get_priority_max, 125, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_sched_get_priority_min +TRACE_SYSCALL_TABLE(sys_sched_get_priority_min, sys_sched_get_priority_min, 126, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_kill +TRACE_SYSCALL_TABLE(sys_kill, sys_kill, 129, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_tkill +TRACE_SYSCALL_TABLE(sys_tkill, sys_tkill, 130, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_tgkill +TRACE_SYSCALL_TABLE(sys_tgkill, sys_tgkill, 131, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_setpriority +TRACE_SYSCALL_TABLE(sys_setpriority, sys_setpriority, 140, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_getpriority +TRACE_SYSCALL_TABLE(sys_getpriority, sys_getpriority, 141, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_setregid +TRACE_SYSCALL_TABLE(sys_setregid, sys_setregid, 143, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_setgid +TRACE_SYSCALL_TABLE(sys_setgid, sys_setgid, 144, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_setreuid +TRACE_SYSCALL_TABLE(sys_setreuid, sys_setreuid, 145, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_setuid +TRACE_SYSCALL_TABLE(sys_setuid, sys_setuid, 146, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_setresuid +TRACE_SYSCALL_TABLE(sys_setresuid, sys_setresuid, 147, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_setresgid +TRACE_SYSCALL_TABLE(sys_setresgid, sys_setresgid, 149, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_setfsuid +TRACE_SYSCALL_TABLE(sys_setfsuid, sys_setfsuid, 151, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_setfsgid +TRACE_SYSCALL_TABLE(sys_setfsgid, sys_setfsgid, 152, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_setpgid +TRACE_SYSCALL_TABLE(sys_setpgid, sys_setpgid, 154, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_getpgid +TRACE_SYSCALL_TABLE(sys_getpgid, sys_getpgid, 155, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_getsid +TRACE_SYSCALL_TABLE(sys_getsid, sys_getsid, 156, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_umask +TRACE_SYSCALL_TABLE(sys_umask, sys_umask, 166, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_prctl +TRACE_SYSCALL_TABLE(sys_prctl, sys_prctl, 167, 5) +#endif +#ifndef OVERRIDE_TABLE_64_sys_msgget +TRACE_SYSCALL_TABLE(sys_msgget, sys_msgget, 186, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_semget +TRACE_SYSCALL_TABLE(sys_semget, sys_semget, 190, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_shmget +TRACE_SYSCALL_TABLE(sys_shmget, sys_shmget, 194, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_socket +TRACE_SYSCALL_TABLE(sys_socket, sys_socket, 198, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_listen +TRACE_SYSCALL_TABLE(sys_listen, sys_listen, 201, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_shutdown +TRACE_SYSCALL_TABLE(sys_shutdown, sys_shutdown, 210, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_brk +TRACE_SYSCALL_TABLE(sys_brk, sys_brk, 214, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_munmap +TRACE_SYSCALL_TABLE(sys_munmap, sys_munmap, 215, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_mremap +TRACE_SYSCALL_TABLE(sys_mremap, sys_mremap, 216, 5) +#endif +#ifndef OVERRIDE_TABLE_64_sys_keyctl +TRACE_SYSCALL_TABLE(sys_keyctl, sys_keyctl, 219, 5) +#endif +#ifndef OVERRIDE_TABLE_64_sys_mmap +TRACE_SYSCALL_TABLE(sys_mmap, sys_mmap, 222, 6) +#endif +#ifndef OVERRIDE_TABLE_64_sys_mprotect +TRACE_SYSCALL_TABLE(sys_mprotect, sys_mprotect, 226, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_msync +TRACE_SYSCALL_TABLE(sys_msync, sys_msync, 227, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_mlock +TRACE_SYSCALL_TABLE(sys_mlock, sys_mlock, 228, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_munlock +TRACE_SYSCALL_TABLE(sys_munlock, sys_munlock, 229, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_mlockall +TRACE_SYSCALL_TABLE(sys_mlockall, sys_mlockall, 230, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_madvise +TRACE_SYSCALL_TABLE(sys_madvise, sys_madvise, 233, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_remap_file_pages +TRACE_SYSCALL_TABLE(sys_remap_file_pages, sys_remap_file_pages, 234, 5) +#endif +#ifndef OVERRIDE_TABLE_64_sys_cacheflush +TRACE_SYSCALL_TABLE(sys_cacheflush, sys_cacheflush, 245, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_set_dataplane +TRACE_SYSCALL_TABLE(sys_set_dataplane, sys_set_dataplane, 246, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_syncfs +TRACE_SYSCALL_TABLE(sys_syncfs, sys_syncfs, 267, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_setns +TRACE_SYSCALL_TABLE(sys_setns, sys_setns, 268, 2) +#endif + +#endif /* CREATE_SYSCALL_TABLE */ diff --git a/instrumentation/syscalls/headers/tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_integers_override.h b/instrumentation/syscalls/headers/tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_integers_override.h new file mode 100644 index 0000000..013be72 --- /dev/null +++ b/instrumentation/syscalls/headers/tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_integers_override.h @@ -0,0 +1,52 @@ +#ifndef CREATE_SYSCALL_TABLE + +#define OVERRIDE_64_sys_sync_file_range +SC_TRACE_EVENT(sys_sync_file_range, + TP_PROTO(int fd, loff_t offset, loff_t nbytes, unsigned int flags), + TP_ARGS(fd, offset, nbytes, flags), + TP_STRUCT__entry( + __field(int, fd) + __field(loff_t, offset) + __field(loff_t, nbytes) + __field_hex(unsigned int, flags)), + TP_fast_assign( + tp_assign(fd, fd) + tp_assign(offset, offset) + tp_assign(nbytes, nbytes) + tp_assign(flags, flags)), + TP_printk() +) + +#define OVERRIDE_64_sys_fadvise64_64 +SC_TRACE_EVENT(sys_fadvise64_64, + TP_PROTO(int fd, loff_t offset, loff_t len, int advice), + TP_ARGS(fd, offset, len, advice), + TP_STRUCT__entry( + __field(int, fd) + __field(loff_t, offset) + __field(loff_t, len) + __field_hex(int, advice)), + TP_fast_assign( + tp_assign(fd, fd) + tp_assign(offset, offset) + tp_assign(len, len) + tp_assign(advice, advice)), + TP_printk() +) + +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_rt_sigreturn) + +#else /* CREATE_SYSCALL_TABLE */ + +#define OVERRIDE_TABLE_64_sys_sync_file_range +TRACE_SYSCALL_TABLE(sys_sync_file_range, sys_sync_file_range, 84, 4) + +#define OVERRIDE_TABLE_64_sys_fadvise64_64 +TRACE_SYSCALL_TABLE(sys_fadvise64_64, sys_fadvise64_64, 223, 4) + +#define OVERRIDE_TABLE_64_sys_rt_sigreturn +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_rt_sigreturn, 139, 0) + +#endif /* CREATE_SYSCALL_TABLE */ + + diff --git a/instrumentation/syscalls/headers/tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_pointers.h b/instrumentation/syscalls/headers/tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_pointers.h new file mode 100644 index 0000000..89d8b60 --- /dev/null +++ b/instrumentation/syscalls/headers/tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_pointers.h @@ -0,0 +1,1872 @@ +/* THIS FILE IS AUTO-GENERATED. DO NOT EDIT */ +#ifndef CREATE_SYSCALL_TABLE + +#if !defined(_TRACE_SYSCALLS_POINTERS_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_SYSCALLS_POINTERS_H + +#include +#include +#include "tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_pointers_override.h" +#include "syscalls_pointers_override.h" + +#ifndef OVERRIDE_64_sys_chdir +SC_TRACE_EVENT(sys_chdir, + TP_PROTO(const char * filename), + TP_ARGS(filename), + TP_STRUCT__entry(__string_from_user(filename, filename)), + TP_fast_assign(tp_copy_string_from_user(filename, filename)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_chroot +SC_TRACE_EVENT(sys_chroot, + TP_PROTO(const char * filename), + TP_ARGS(filename), + TP_STRUCT__entry(__string_from_user(filename, filename)), + TP_fast_assign(tp_copy_string_from_user(filename, filename)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_acct +SC_TRACE_EVENT(sys_acct, + TP_PROTO(const char * name), + TP_ARGS(name), + TP_STRUCT__entry(__string_from_user(name, name)), + TP_fast_assign(tp_copy_string_from_user(name, name)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_set_tid_address +SC_TRACE_EVENT(sys_set_tid_address, + TP_PROTO(int * tidptr), + TP_ARGS(tidptr), + TP_STRUCT__entry(__field_hex(int *, tidptr)), + TP_fast_assign(tp_assign(tidptr, tidptr)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_times +SC_TRACE_EVENT(sys_times, + TP_PROTO(struct tms * tbuf), + TP_ARGS(tbuf), + TP_STRUCT__entry(__field_hex(struct tms *, tbuf)), + TP_fast_assign(tp_assign(tbuf, tbuf)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_newuname +SC_TRACE_EVENT(sys_newuname, + TP_PROTO(struct new_utsname * name), + TP_ARGS(name), + TP_STRUCT__entry(__field_hex(struct new_utsname *, name)), + TP_fast_assign(tp_assign(name, name)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_adjtimex +SC_TRACE_EVENT(sys_adjtimex, + TP_PROTO(struct timex * txc_p), + TP_ARGS(txc_p), + TP_STRUCT__entry(__field_hex(struct timex *, txc_p)), + TP_fast_assign(tp_assign(txc_p, txc_p)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_sysinfo +SC_TRACE_EVENT(sys_sysinfo, + TP_PROTO(struct sysinfo * info), + TP_ARGS(info), + TP_STRUCT__entry(__field_hex(struct sysinfo *, info)), + TP_fast_assign(tp_assign(info, info)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_mq_unlink +SC_TRACE_EVENT(sys_mq_unlink, + TP_PROTO(const char * u_name), + TP_ARGS(u_name), + TP_STRUCT__entry(__string_from_user(u_name, u_name)), + TP_fast_assign(tp_copy_string_from_user(u_name, u_name)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_shmdt +SC_TRACE_EVENT(sys_shmdt, + TP_PROTO(char * shmaddr), + TP_ARGS(shmaddr), + TP_STRUCT__entry(__field_hex(char *, shmaddr)), + TP_fast_assign(tp_assign(shmaddr, shmaddr)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_swapoff +SC_TRACE_EVENT(sys_swapoff, + TP_PROTO(const char * specialfile), + TP_ARGS(specialfile), + TP_STRUCT__entry(__string_from_user(specialfile, specialfile)), + TP_fast_assign(tp_copy_string_from_user(specialfile, specialfile)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_io_setup +SC_TRACE_EVENT(sys_io_setup, + TP_PROTO(unsigned nr_events, aio_context_t * ctxp), + TP_ARGS(nr_events, ctxp), + TP_STRUCT__entry(__field(unsigned, nr_events) __field_hex(aio_context_t *, ctxp)), + TP_fast_assign(tp_assign(nr_events, nr_events) tp_assign(ctxp, ctxp)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_removexattr +SC_TRACE_EVENT(sys_removexattr, + TP_PROTO(const char * pathname, const char * name), + TP_ARGS(pathname, name), + TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name)), + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_lremovexattr +SC_TRACE_EVENT(sys_lremovexattr, + TP_PROTO(const char * pathname, const char * name), + TP_ARGS(pathname, name), + TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name)), + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_fremovexattr +SC_TRACE_EVENT(sys_fremovexattr, + TP_PROTO(int fd, const char * name), + TP_ARGS(fd, name), + TP_STRUCT__entry(__field(int, fd) __string_from_user(name, name)), + TP_fast_assign(tp_assign(fd, fd) tp_copy_string_from_user(name, name)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_getcwd +SC_TRACE_EVENT(sys_getcwd, + TP_PROTO(char * buf, unsigned long size), + TP_ARGS(buf, size), + TP_STRUCT__entry(__field_hex(char *, buf) __field(unsigned long, size)), + TP_fast_assign(tp_assign(buf, buf) tp_assign(size, size)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_umount +SC_TRACE_EVENT(sys_umount, + TP_PROTO(char * name, int flags), + TP_ARGS(name, flags), + TP_STRUCT__entry(__string_from_user(name, name) __field(int, flags)), + TP_fast_assign(tp_copy_string_from_user(name, name) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_pivot_root +SC_TRACE_EVENT(sys_pivot_root, + TP_PROTO(const char * new_root, const char * put_old), + TP_ARGS(new_root, put_old), + TP_STRUCT__entry(__string_from_user(new_root, new_root) __string_from_user(put_old, put_old)), + TP_fast_assign(tp_copy_string_from_user(new_root, new_root) tp_copy_string_from_user(put_old, put_old)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_statfs +SC_TRACE_EVENT(sys_statfs, + TP_PROTO(const char * pathname, struct statfs * buf), + TP_ARGS(pathname, buf), + TP_STRUCT__entry(__string_from_user(pathname, pathname) __field_hex(struct statfs *, buf)), + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_assign(buf, buf)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_fstatfs +SC_TRACE_EVENT(sys_fstatfs, + TP_PROTO(unsigned int fd, struct statfs * buf), + TP_ARGS(fd, buf), + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(struct statfs *, buf)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(buf, buf)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_truncate +SC_TRACE_EVENT(sys_truncate, + TP_PROTO(const char * path, long length), + TP_ARGS(path, length), + TP_STRUCT__entry(__string_from_user(path, path) __field(long, length)), + TP_fast_assign(tp_copy_string_from_user(path, path) tp_assign(length, length)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_pipe2 +SC_TRACE_EVENT(sys_pipe2, + TP_PROTO(int * fildes, int flags), + TP_ARGS(fildes, flags), + TP_STRUCT__entry(__field_hex(int *, fildes) __field(int, flags)), + TP_fast_assign(tp_assign(fildes, fildes) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_newfstat +SC_TRACE_EVENT(sys_newfstat, + TP_PROTO(unsigned int fd, struct stat * statbuf), + TP_ARGS(fd, statbuf), + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(struct stat *, statbuf)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(statbuf, statbuf)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_timerfd_gettime +SC_TRACE_EVENT(sys_timerfd_gettime, + TP_PROTO(int ufd, struct itimerspec * otmr), + TP_ARGS(ufd, otmr), + TP_STRUCT__entry(__field(int, ufd) __field_hex(struct itimerspec *, otmr)), + TP_fast_assign(tp_assign(ufd, ufd) tp_assign(otmr, otmr)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_set_robust_list +SC_TRACE_EVENT(sys_set_robust_list, + TP_PROTO(struct robust_list_head * head, size_t len), + TP_ARGS(head, len), + TP_STRUCT__entry(__field_hex(struct robust_list_head *, head) __field(size_t, len)), + TP_fast_assign(tp_assign(head, head) tp_assign(len, len)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_nanosleep +SC_TRACE_EVENT(sys_nanosleep, + TP_PROTO(struct timespec * rqtp, struct timespec * rmtp), + TP_ARGS(rqtp, rmtp), + TP_STRUCT__entry(__field_hex(struct timespec *, rqtp) __field_hex(struct timespec *, rmtp)), + TP_fast_assign(tp_assign(rqtp, rqtp) tp_assign(rmtp, rmtp)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_getitimer +SC_TRACE_EVENT(sys_getitimer, + TP_PROTO(int which, struct itimerval * value), + TP_ARGS(which, value), + TP_STRUCT__entry(__field(int, which) __field_hex(struct itimerval *, value)), + TP_fast_assign(tp_assign(which, which) tp_assign(value, value)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_delete_module +SC_TRACE_EVENT(sys_delete_module, + TP_PROTO(const char * name_user, unsigned int flags), + TP_ARGS(name_user, flags), + TP_STRUCT__entry(__string_from_user(name_user, name_user) __field(unsigned int, flags)), + TP_fast_assign(tp_copy_string_from_user(name_user, name_user) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_timer_gettime +SC_TRACE_EVENT(sys_timer_gettime, + TP_PROTO(timer_t timer_id, struct itimerspec * setting), + TP_ARGS(timer_id, setting), + TP_STRUCT__entry(__field(timer_t, timer_id) __field_hex(struct itimerspec *, setting)), + TP_fast_assign(tp_assign(timer_id, timer_id) tp_assign(setting, setting)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_clock_settime +SC_TRACE_EVENT(sys_clock_settime, + TP_PROTO(const clockid_t which_clock, const struct timespec * tp), + TP_ARGS(which_clock, tp), + TP_STRUCT__entry(__field(const clockid_t, which_clock) __field_hex(const struct timespec *, tp)), + TP_fast_assign(tp_assign(which_clock, which_clock) tp_assign(tp, tp)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_clock_gettime +SC_TRACE_EVENT(sys_clock_gettime, + TP_PROTO(const clockid_t which_clock, struct timespec * tp), + TP_ARGS(which_clock, tp), + TP_STRUCT__entry(__field(const clockid_t, which_clock) __field_hex(struct timespec *, tp)), + TP_fast_assign(tp_assign(which_clock, which_clock) tp_assign(tp, tp)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_clock_getres +SC_TRACE_EVENT(sys_clock_getres, + TP_PROTO(const clockid_t which_clock, struct timespec * tp), + TP_ARGS(which_clock, tp), + TP_STRUCT__entry(__field(const clockid_t, which_clock) __field_hex(struct timespec *, tp)), + TP_fast_assign(tp_assign(which_clock, which_clock) tp_assign(tp, tp)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_sched_setparam +SC_TRACE_EVENT(sys_sched_setparam, + TP_PROTO(pid_t pid, struct sched_param * param), + TP_ARGS(pid, param), + TP_STRUCT__entry(__field(pid_t, pid) __field_hex(struct sched_param *, param)), + TP_fast_assign(tp_assign(pid, pid) tp_assign(param, param)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_sched_getparam +SC_TRACE_EVENT(sys_sched_getparam, + TP_PROTO(pid_t pid, struct sched_param * param), + TP_ARGS(pid, param), + TP_STRUCT__entry(__field(pid_t, pid) __field_hex(struct sched_param *, param)), + TP_fast_assign(tp_assign(pid, pid) tp_assign(param, param)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_sched_rr_get_interval +SC_TRACE_EVENT(sys_sched_rr_get_interval, + TP_PROTO(pid_t pid, struct timespec * interval), + TP_ARGS(pid, interval), + TP_STRUCT__entry(__field(pid_t, pid) __field_hex(struct timespec *, interval)), + TP_fast_assign(tp_assign(pid, pid) tp_assign(interval, interval)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_rt_sigsuspend +SC_TRACE_EVENT(sys_rt_sigsuspend, + TP_PROTO(sigset_t * unewset, size_t sigsetsize), + TP_ARGS(unewset, sigsetsize), + TP_STRUCT__entry(__field_hex(sigset_t *, unewset) __field(size_t, sigsetsize)), + TP_fast_assign(tp_assign(unewset, unewset) tp_assign(sigsetsize, sigsetsize)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_rt_sigpending +SC_TRACE_EVENT(sys_rt_sigpending, + TP_PROTO(sigset_t * set, size_t sigsetsize), + TP_ARGS(set, sigsetsize), + TP_STRUCT__entry(__field_hex(sigset_t *, set) __field(size_t, sigsetsize)), + TP_fast_assign(tp_assign(set, set) tp_assign(sigsetsize, sigsetsize)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_getgroups +SC_TRACE_EVENT(sys_getgroups, + TP_PROTO(int gidsetsize, gid_t * grouplist), + TP_ARGS(gidsetsize, grouplist), + TP_STRUCT__entry(__field(int, gidsetsize) __field_hex(gid_t *, grouplist)), + TP_fast_assign(tp_assign(gidsetsize, gidsetsize) tp_assign(grouplist, grouplist)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_setgroups +SC_TRACE_EVENT(sys_setgroups, + TP_PROTO(int gidsetsize, gid_t * grouplist), + TP_ARGS(gidsetsize, grouplist), + TP_STRUCT__entry(__field(int, gidsetsize) __field_hex(gid_t *, grouplist)), + TP_fast_assign(tp_assign(gidsetsize, gidsetsize) tp_assign(grouplist, grouplist)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_sethostname +SC_TRACE_EVENT(sys_sethostname, + TP_PROTO(char * name, int len), + TP_ARGS(name, len), + TP_STRUCT__entry(__string_from_user(name, name) __field(int, len)), + TP_fast_assign(tp_copy_string_from_user(name, name) tp_assign(len, len)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_setdomainname +SC_TRACE_EVENT(sys_setdomainname, + TP_PROTO(char * name, int len), + TP_ARGS(name, len), + TP_STRUCT__entry(__string_from_user(name, name) __field(int, len)), + TP_fast_assign(tp_copy_string_from_user(name, name) tp_assign(len, len)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_getrlimit +SC_TRACE_EVENT(sys_getrlimit, + TP_PROTO(unsigned int resource, struct rlimit * rlim), + TP_ARGS(resource, rlim), + TP_STRUCT__entry(__field(unsigned int, resource) __field_hex(struct rlimit *, rlim)), + TP_fast_assign(tp_assign(resource, resource) tp_assign(rlim, rlim)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_setrlimit +SC_TRACE_EVENT(sys_setrlimit, + TP_PROTO(unsigned int resource, struct rlimit * rlim), + TP_ARGS(resource, rlim), + TP_STRUCT__entry(__field(unsigned int, resource) __field_hex(struct rlimit *, rlim)), + TP_fast_assign(tp_assign(resource, resource) tp_assign(rlim, rlim)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_getrusage +SC_TRACE_EVENT(sys_getrusage, + TP_PROTO(int who, struct rusage * ru), + TP_ARGS(who, ru), + TP_STRUCT__entry(__field(int, who) __field_hex(struct rusage *, ru)), + TP_fast_assign(tp_assign(who, who) tp_assign(ru, ru)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_gettimeofday +SC_TRACE_EVENT(sys_gettimeofday, + TP_PROTO(struct timeval * tv, struct timezone * tz), + TP_ARGS(tv, tz), + TP_STRUCT__entry(__field_hex(struct timeval *, tv) __field_hex(struct timezone *, tz)), + TP_fast_assign(tp_assign(tv, tv) tp_assign(tz, tz)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_settimeofday +SC_TRACE_EVENT(sys_settimeofday, + TP_PROTO(struct timeval * tv, struct timezone * tz), + TP_ARGS(tv, tz), + TP_STRUCT__entry(__field_hex(struct timeval *, tv) __field_hex(struct timezone *, tz)), + TP_fast_assign(tp_assign(tv, tv) tp_assign(tz, tz)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_mq_notify +SC_TRACE_EVENT(sys_mq_notify, + TP_PROTO(mqd_t mqdes, const struct sigevent * u_notification), + TP_ARGS(mqdes, u_notification), + TP_STRUCT__entry(__field(mqd_t, mqdes) __field_hex(const struct sigevent *, u_notification)), + TP_fast_assign(tp_assign(mqdes, mqdes) tp_assign(u_notification, u_notification)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_swapon +SC_TRACE_EVENT(sys_swapon, + TP_PROTO(const char * specialfile, int swap_flags), + TP_ARGS(specialfile, swap_flags), + TP_STRUCT__entry(__string_from_user(specialfile, specialfile) __field(int, swap_flags)), + TP_fast_assign(tp_copy_string_from_user(specialfile, specialfile) tp_assign(swap_flags, swap_flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_clock_adjtime +SC_TRACE_EVENT(sys_clock_adjtime, + TP_PROTO(const clockid_t which_clock, struct timex * utx), + TP_ARGS(which_clock, utx), + TP_STRUCT__entry(__field(const clockid_t, which_clock) __field_hex(struct timex *, utx)), + TP_fast_assign(tp_assign(which_clock, which_clock) tp_assign(utx, utx)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_io_submit +SC_TRACE_EVENT(sys_io_submit, + TP_PROTO(aio_context_t ctx_id, long nr, struct iocb * * iocbpp), + TP_ARGS(ctx_id, nr, iocbpp), + TP_STRUCT__entry(__field(aio_context_t, ctx_id) __field(long, nr) __field_hex(struct iocb * *, iocbpp)), + TP_fast_assign(tp_assign(ctx_id, ctx_id) tp_assign(nr, nr) tp_assign(iocbpp, iocbpp)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_io_cancel +SC_TRACE_EVENT(sys_io_cancel, + TP_PROTO(aio_context_t ctx_id, struct iocb * iocb, struct io_event * result), + TP_ARGS(ctx_id, iocb, result), + TP_STRUCT__entry(__field(aio_context_t, ctx_id) __field_hex(struct iocb *, iocb) __field_hex(struct io_event *, result)), + TP_fast_assign(tp_assign(ctx_id, ctx_id) tp_assign(iocb, iocb) tp_assign(result, result)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_listxattr +SC_TRACE_EVENT(sys_listxattr, + TP_PROTO(const char * pathname, char * list, size_t size), + TP_ARGS(pathname, list, size), + TP_STRUCT__entry(__string_from_user(pathname, pathname) __field_hex(char *, list) __field(size_t, size)), + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_assign(list, list) tp_assign(size, size)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_llistxattr +SC_TRACE_EVENT(sys_llistxattr, + TP_PROTO(const char * pathname, char * list, size_t size), + TP_ARGS(pathname, list, size), + TP_STRUCT__entry(__string_from_user(pathname, pathname) __field_hex(char *, list) __field(size_t, size)), + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_assign(list, list) tp_assign(size, size)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_flistxattr +SC_TRACE_EVENT(sys_flistxattr, + TP_PROTO(int fd, char * list, size_t size), + TP_ARGS(fd, list, size), + TP_STRUCT__entry(__field(int, fd) __field_hex(char *, list) __field(size_t, size)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(list, list) tp_assign(size, size)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_inotify_add_watch +SC_TRACE_EVENT(sys_inotify_add_watch, + TP_PROTO(int fd, const char * pathname, u32 mask), + TP_ARGS(fd, pathname, mask), + TP_STRUCT__entry(__field(int, fd) __string_from_user(pathname, pathname) __field(u32, mask)), + TP_fast_assign(tp_assign(fd, fd) tp_copy_string_from_user(pathname, pathname) tp_assign(mask, mask)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_mkdirat +SC_TRACE_EVENT(sys_mkdirat, + TP_PROTO(int dfd, const char * pathname, int mode), + TP_ARGS(dfd, pathname, mode), + TP_STRUCT__entry(__field(int, dfd) __string_from_user(pathname, pathname) __field(int, mode)), + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(pathname, pathname) tp_assign(mode, mode)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_unlinkat +SC_TRACE_EVENT(sys_unlinkat, + TP_PROTO(int dfd, const char * pathname, int flag), + TP_ARGS(dfd, pathname, flag), + TP_STRUCT__entry(__field(int, dfd) __string_from_user(pathname, pathname) __field(int, flag)), + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(pathname, pathname) tp_assign(flag, flag)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_symlinkat +SC_TRACE_EVENT(sys_symlinkat, + TP_PROTO(const char * oldname, int newdfd, const char * newname), + TP_ARGS(oldname, newdfd, newname), + TP_STRUCT__entry(__string_from_user(oldname, oldname) __field(int, newdfd) __string_from_user(newname, newname)), + TP_fast_assign(tp_copy_string_from_user(oldname, oldname) tp_assign(newdfd, newdfd) tp_copy_string_from_user(newname, newname)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_nfsservctl +SC_TRACE_EVENT(sys_nfsservctl, + TP_PROTO(int cmd, struct nfsctl_arg * arg, void * res), + TP_ARGS(cmd, arg, res), + TP_STRUCT__entry(__field(int, cmd) __field_hex(struct nfsctl_arg *, arg) __field_hex(void *, res)), + TP_fast_assign(tp_assign(cmd, cmd) tp_assign(arg, arg) tp_assign(res, res)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_faccessat +SC_TRACE_EVENT(sys_faccessat, + TP_PROTO(int dfd, const char * filename, int mode), + TP_ARGS(dfd, filename, mode), + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field(int, mode)), + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(mode, mode)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_fchmodat +SC_TRACE_EVENT(sys_fchmodat, + TP_PROTO(int dfd, const char * filename, mode_t mode), + TP_ARGS(dfd, filename, mode), + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field(mode_t, mode)), + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(mode, mode)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_getdents64 +SC_TRACE_EVENT(sys_getdents64, + TP_PROTO(unsigned int fd, struct linux_dirent64 * dirent, unsigned int count), + TP_ARGS(fd, dirent, count), + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(struct linux_dirent64 *, dirent) __field(unsigned int, count)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(dirent, dirent) tp_assign(count, count)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_read +SC_TRACE_EVENT(sys_read, + TP_PROTO(unsigned int fd, char * buf, size_t count), + TP_ARGS(fd, buf, count), + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(char *, buf) __field(size_t, count)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(buf, buf) tp_assign(count, count)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_write +SC_TRACE_EVENT(sys_write, + TP_PROTO(unsigned int fd, const char * buf, size_t count), + TP_ARGS(fd, buf, count), + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(const char *, buf) __field(size_t, count)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(buf, buf) tp_assign(count, count)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_readv +SC_TRACE_EVENT(sys_readv, + TP_PROTO(unsigned long fd, const struct iovec * vec, unsigned long vlen), + TP_ARGS(fd, vec, vlen), + TP_STRUCT__entry(__field(unsigned long, fd) __field_hex(const struct iovec *, vec) __field(unsigned long, vlen)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(vec, vec) tp_assign(vlen, vlen)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_writev +SC_TRACE_EVENT(sys_writev, + TP_PROTO(unsigned long fd, const struct iovec * vec, unsigned long vlen), + TP_ARGS(fd, vec, vlen), + TP_STRUCT__entry(__field(unsigned long, fd) __field_hex(const struct iovec *, vec) __field(unsigned long, vlen)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(vec, vec) tp_assign(vlen, vlen)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_get_robust_list +SC_TRACE_EVENT(sys_get_robust_list, + TP_PROTO(int pid, struct robust_list_head * * head_ptr, size_t * len_ptr), + TP_ARGS(pid, head_ptr, len_ptr), + TP_STRUCT__entry(__field(int, pid) __field_hex(struct robust_list_head * *, head_ptr) __field_hex(size_t *, len_ptr)), + TP_fast_assign(tp_assign(pid, pid) tp_assign(head_ptr, head_ptr) tp_assign(len_ptr, len_ptr)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_setitimer +SC_TRACE_EVENT(sys_setitimer, + TP_PROTO(int which, struct itimerval * value, struct itimerval * ovalue), + TP_ARGS(which, value, ovalue), + TP_STRUCT__entry(__field(int, which) __field_hex(struct itimerval *, value) __field_hex(struct itimerval *, ovalue)), + TP_fast_assign(tp_assign(which, which) tp_assign(value, value) tp_assign(ovalue, ovalue)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_init_module +SC_TRACE_EVENT(sys_init_module, + TP_PROTO(void * umod, unsigned long len, const char * uargs), + TP_ARGS(umod, len, uargs), + TP_STRUCT__entry(__field_hex(void *, umod) __field(unsigned long, len) __field_hex(const char *, uargs)), + TP_fast_assign(tp_assign(umod, umod) tp_assign(len, len) tp_assign(uargs, uargs)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_timer_create +SC_TRACE_EVENT(sys_timer_create, + TP_PROTO(const clockid_t which_clock, struct sigevent * timer_event_spec, timer_t * created_timer_id), + TP_ARGS(which_clock, timer_event_spec, created_timer_id), + TP_STRUCT__entry(__field(const clockid_t, which_clock) __field_hex(struct sigevent *, timer_event_spec) __field_hex(timer_t *, created_timer_id)), + TP_fast_assign(tp_assign(which_clock, which_clock) tp_assign(timer_event_spec, timer_event_spec) tp_assign(created_timer_id, created_timer_id)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_syslog +SC_TRACE_EVENT(sys_syslog, + TP_PROTO(int type, char * buf, int len), + TP_ARGS(type, buf, len), + TP_STRUCT__entry(__field(int, type) __field_hex(char *, buf) __field(int, len)), + TP_fast_assign(tp_assign(type, type) tp_assign(buf, buf) tp_assign(len, len)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_sched_setscheduler +SC_TRACE_EVENT(sys_sched_setscheduler, + TP_PROTO(pid_t pid, int policy, struct sched_param * param), + TP_ARGS(pid, policy, param), + TP_STRUCT__entry(__field(pid_t, pid) __field(int, policy) __field_hex(struct sched_param *, param)), + TP_fast_assign(tp_assign(pid, pid) tp_assign(policy, policy) tp_assign(param, param)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_sched_setaffinity +SC_TRACE_EVENT(sys_sched_setaffinity, + TP_PROTO(pid_t pid, unsigned int len, unsigned long * user_mask_ptr), + TP_ARGS(pid, len, user_mask_ptr), + TP_STRUCT__entry(__field(pid_t, pid) __field(unsigned int, len) __field_hex(unsigned long *, user_mask_ptr)), + TP_fast_assign(tp_assign(pid, pid) tp_assign(len, len) tp_assign(user_mask_ptr, user_mask_ptr)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_sched_getaffinity +SC_TRACE_EVENT(sys_sched_getaffinity, + TP_PROTO(pid_t pid, unsigned int len, unsigned long * user_mask_ptr), + TP_ARGS(pid, len, user_mask_ptr), + TP_STRUCT__entry(__field(pid_t, pid) __field(unsigned int, len) __field_hex(unsigned long *, user_mask_ptr)), + TP_fast_assign(tp_assign(pid, pid) tp_assign(len, len) tp_assign(user_mask_ptr, user_mask_ptr)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_rt_sigqueueinfo +SC_TRACE_EVENT(sys_rt_sigqueueinfo, + TP_PROTO(pid_t pid, int sig, siginfo_t * uinfo), + TP_ARGS(pid, sig, uinfo), + TP_STRUCT__entry(__field(pid_t, pid) __field(int, sig) __field_hex(siginfo_t *, uinfo)), + TP_fast_assign(tp_assign(pid, pid) tp_assign(sig, sig) tp_assign(uinfo, uinfo)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_getresuid +SC_TRACE_EVENT(sys_getresuid, + TP_PROTO(uid_t * ruid, uid_t * euid, uid_t * suid), + TP_ARGS(ruid, euid, suid), + TP_STRUCT__entry(__field_hex(uid_t *, ruid) __field_hex(uid_t *, euid) __field_hex(uid_t *, suid)), + TP_fast_assign(tp_assign(ruid, ruid) tp_assign(euid, euid) tp_assign(suid, suid)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_getresgid +SC_TRACE_EVENT(sys_getresgid, + TP_PROTO(gid_t * rgid, gid_t * egid, gid_t * sgid), + TP_ARGS(rgid, egid, sgid), + TP_STRUCT__entry(__field_hex(gid_t *, rgid) __field_hex(gid_t *, egid) __field_hex(gid_t *, sgid)), + TP_fast_assign(tp_assign(rgid, rgid) tp_assign(egid, egid) tp_assign(sgid, sgid)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_getcpu +SC_TRACE_EVENT(sys_getcpu, + TP_PROTO(unsigned * cpup, unsigned * nodep, struct getcpu_cache * unused), + TP_ARGS(cpup, nodep, unused), + TP_STRUCT__entry(__field_hex(unsigned *, cpup) __field_hex(unsigned *, nodep) __field_hex(struct getcpu_cache *, unused)), + TP_fast_assign(tp_assign(cpup, cpup) tp_assign(nodep, nodep) tp_assign(unused, unused)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_mq_getsetattr +SC_TRACE_EVENT(sys_mq_getsetattr, + TP_PROTO(mqd_t mqdes, const struct mq_attr * u_mqstat, struct mq_attr * u_omqstat), + TP_ARGS(mqdes, u_mqstat, u_omqstat), + TP_STRUCT__entry(__field(mqd_t, mqdes) __field_hex(const struct mq_attr *, u_mqstat) __field_hex(struct mq_attr *, u_omqstat)), + TP_fast_assign(tp_assign(mqdes, mqdes) tp_assign(u_mqstat, u_mqstat) tp_assign(u_omqstat, u_omqstat)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_msgctl +SC_TRACE_EVENT(sys_msgctl, + TP_PROTO(int msqid, int cmd, struct msqid_ds * buf), + TP_ARGS(msqid, cmd, buf), + TP_STRUCT__entry(__field(int, msqid) __field(int, cmd) __field_hex(struct msqid_ds *, buf)), + TP_fast_assign(tp_assign(msqid, msqid) tp_assign(cmd, cmd) tp_assign(buf, buf)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_semop +SC_TRACE_EVENT(sys_semop, + TP_PROTO(int semid, struct sembuf * tsops, unsigned nsops), + TP_ARGS(semid, tsops, nsops), + TP_STRUCT__entry(__field(int, semid) __field_hex(struct sembuf *, tsops) __field(unsigned, nsops)), + TP_fast_assign(tp_assign(semid, semid) tp_assign(tsops, tsops) tp_assign(nsops, nsops)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_shmctl +SC_TRACE_EVENT(sys_shmctl, + TP_PROTO(int shmid, int cmd, struct shmid_ds * buf), + TP_ARGS(shmid, cmd, buf), + TP_STRUCT__entry(__field(int, shmid) __field(int, cmd) __field_hex(struct shmid_ds *, buf)), + TP_fast_assign(tp_assign(shmid, shmid) tp_assign(cmd, cmd) tp_assign(buf, buf)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_shmat +SC_TRACE_EVENT(sys_shmat, + TP_PROTO(int shmid, char * shmaddr, int shmflg), + TP_ARGS(shmid, shmaddr, shmflg), + TP_STRUCT__entry(__field(int, shmid) __field_hex(char *, shmaddr) __field(int, shmflg)), + TP_fast_assign(tp_assign(shmid, shmid) tp_assign(shmaddr, shmaddr) tp_assign(shmflg, shmflg)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_bind +SC_TRACE_EVENT(sys_bind, + TP_PROTO(int fd, struct sockaddr * umyaddr, int addrlen), + TP_ARGS(fd, umyaddr, addrlen), + TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, umyaddr) __field_hex(int, addrlen)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(umyaddr, umyaddr) tp_assign(addrlen, addrlen)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_accept +SC_TRACE_EVENT(sys_accept, + TP_PROTO(int fd, struct sockaddr * upeer_sockaddr, int * upeer_addrlen), + TP_ARGS(fd, upeer_sockaddr, upeer_addrlen), + TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, upeer_sockaddr) __field_hex(int *, upeer_addrlen)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(upeer_sockaddr, upeer_sockaddr) tp_assign(upeer_addrlen, upeer_addrlen)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_connect +SC_TRACE_EVENT(sys_connect, + TP_PROTO(int fd, struct sockaddr * uservaddr, int addrlen), + TP_ARGS(fd, uservaddr, addrlen), + TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, uservaddr) __field_hex(int, addrlen)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(uservaddr, uservaddr) tp_assign(addrlen, addrlen)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_getsockname +SC_TRACE_EVENT(sys_getsockname, + TP_PROTO(int fd, struct sockaddr * usockaddr, int * usockaddr_len), + TP_ARGS(fd, usockaddr, usockaddr_len), + TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, usockaddr) __field_hex(int *, usockaddr_len)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(usockaddr, usockaddr) tp_assign(usockaddr_len, usockaddr_len)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_getpeername +SC_TRACE_EVENT(sys_getpeername, + TP_PROTO(int fd, struct sockaddr * usockaddr, int * usockaddr_len), + TP_ARGS(fd, usockaddr, usockaddr_len), + TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, usockaddr) __field_hex(int *, usockaddr_len)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(usockaddr, usockaddr) tp_assign(usockaddr_len, usockaddr_len)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_sendmsg +SC_TRACE_EVENT(sys_sendmsg, + TP_PROTO(int fd, struct msghdr * msg, unsigned flags), + TP_ARGS(fd, msg, flags), + TP_STRUCT__entry(__field(int, fd) __field_hex(struct msghdr *, msg) __field(unsigned, flags)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(msg, msg) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_recvmsg +SC_TRACE_EVENT(sys_recvmsg, + TP_PROTO(int fd, struct msghdr * msg, unsigned int flags), + TP_ARGS(fd, msg, flags), + TP_STRUCT__entry(__field(int, fd) __field_hex(struct msghdr *, msg) __field(unsigned int, flags)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(msg, msg) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_mincore +SC_TRACE_EVENT(sys_mincore, + TP_PROTO(unsigned long start, size_t len, unsigned char * vec), + TP_ARGS(start, len, vec), + TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len) __field_hex(unsigned char *, vec)), + TP_fast_assign(tp_assign(start, start) tp_assign(len, len) tp_assign(vec, vec)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_set_mempolicy +SC_TRACE_EVENT(sys_set_mempolicy, + TP_PROTO(int mode, unsigned long * nmask, unsigned long maxnode), + TP_ARGS(mode, nmask, maxnode), + TP_STRUCT__entry(__field(int, mode) __field_hex(unsigned long *, nmask) __field(unsigned long, maxnode)), + TP_fast_assign(tp_assign(mode, mode) tp_assign(nmask, nmask) tp_assign(maxnode, maxnode)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_open_by_handle_at +SC_TRACE_EVENT(sys_open_by_handle_at, + TP_PROTO(int mountdirfd, struct file_handle * handle, int flags), + TP_ARGS(mountdirfd, handle, flags), + TP_STRUCT__entry(__field(int, mountdirfd) __field_hex(struct file_handle *, handle) __field(int, flags)), + TP_fast_assign(tp_assign(mountdirfd, mountdirfd) tp_assign(handle, handle) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_getxattr +SC_TRACE_EVENT(sys_getxattr, + TP_PROTO(const char * pathname, const char * name, void * value, size_t size), + TP_ARGS(pathname, name, value, size), + TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name) __field_hex(void *, value) __field(size_t, size)), + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_lgetxattr +SC_TRACE_EVENT(sys_lgetxattr, + TP_PROTO(const char * pathname, const char * name, void * value, size_t size), + TP_ARGS(pathname, name, value, size), + TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name) __field_hex(void *, value) __field(size_t, size)), + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_fgetxattr +SC_TRACE_EVENT(sys_fgetxattr, + TP_PROTO(int fd, const char * name, void * value, size_t size), + TP_ARGS(fd, name, value, size), + TP_STRUCT__entry(__field(int, fd) __string_from_user(name, name) __field_hex(void *, value) __field(size_t, size)), + TP_fast_assign(tp_assign(fd, fd) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_epoll_ctl +SC_TRACE_EVENT(sys_epoll_ctl, + TP_PROTO(int epfd, int op, int fd, struct epoll_event * event), + TP_ARGS(epfd, op, fd, event), + TP_STRUCT__entry(__field(int, epfd) __field(int, op) __field(int, fd) __field_hex(struct epoll_event *, event)), + TP_fast_assign(tp_assign(epfd, epfd) tp_assign(op, op) tp_assign(fd, fd) tp_assign(event, event)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_mknodat +SC_TRACE_EVENT(sys_mknodat, + TP_PROTO(int dfd, const char * filename, int mode, unsigned dev), + TP_ARGS(dfd, filename, mode, dev), + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field(int, mode) __field(unsigned, dev)), + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(mode, mode) tp_assign(dev, dev)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_renameat +SC_TRACE_EVENT(sys_renameat, + TP_PROTO(int olddfd, const char * oldname, int newdfd, const char * newname), + TP_ARGS(olddfd, oldname, newdfd, newname), + TP_STRUCT__entry(__field(int, olddfd) __string_from_user(oldname, oldname) __field(int, newdfd) __string_from_user(newname, newname)), + TP_fast_assign(tp_assign(olddfd, olddfd) tp_copy_string_from_user(oldname, oldname) tp_assign(newdfd, newdfd) tp_copy_string_from_user(newname, newname)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_openat +SC_TRACE_EVENT(sys_openat, + TP_PROTO(int dfd, const char * filename, int flags, int mode), + TP_ARGS(dfd, filename, flags, mode), + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field(int, flags) __field(int, mode)), + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(flags, flags) tp_assign(mode, mode)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_quotactl +SC_TRACE_EVENT(sys_quotactl, + TP_PROTO(unsigned int cmd, const char * special, qid_t id, void * addr), + TP_ARGS(cmd, special, id, addr), + TP_STRUCT__entry(__field(unsigned int, cmd) __field_hex(const char *, special) __field(qid_t, id) __field_hex(void *, addr)), + TP_fast_assign(tp_assign(cmd, cmd) tp_assign(special, special) tp_assign(id, id) tp_assign(addr, addr)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_sendfile64 +SC_TRACE_EVENT(sys_sendfile64, + TP_PROTO(int out_fd, int in_fd, loff_t * offset, size_t count), + TP_ARGS(out_fd, in_fd, offset, count), + TP_STRUCT__entry(__field(int, out_fd) __field(int, in_fd) __field_hex(loff_t *, offset) __field(size_t, count)), + TP_fast_assign(tp_assign(out_fd, out_fd) tp_assign(in_fd, in_fd) tp_assign(offset, offset) tp_assign(count, count)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_signalfd4 +SC_TRACE_EVENT(sys_signalfd4, + TP_PROTO(int ufd, sigset_t * user_mask, size_t sizemask, int flags), + TP_ARGS(ufd, user_mask, sizemask, flags), + TP_STRUCT__entry(__field(int, ufd) __field_hex(sigset_t *, user_mask) __field(size_t, sizemask) __field(int, flags)), + TP_fast_assign(tp_assign(ufd, ufd) tp_assign(user_mask, user_mask) tp_assign(sizemask, sizemask) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_vmsplice +SC_TRACE_EVENT(sys_vmsplice, + TP_PROTO(int fd, const struct iovec * iov, unsigned long nr_segs, unsigned int flags), + TP_ARGS(fd, iov, nr_segs, flags), + TP_STRUCT__entry(__field(int, fd) __field_hex(const struct iovec *, iov) __field(unsigned long, nr_segs) __field(unsigned int, flags)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(iov, iov) tp_assign(nr_segs, nr_segs) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_readlinkat +SC_TRACE_EVENT(sys_readlinkat, + TP_PROTO(int dfd, const char * pathname, char * buf, int bufsiz), + TP_ARGS(dfd, pathname, buf, bufsiz), + TP_STRUCT__entry(__field(int, dfd) __string_from_user(pathname, pathname) __field_hex(char *, buf) __field(int, bufsiz)), + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(pathname, pathname) tp_assign(buf, buf) tp_assign(bufsiz, bufsiz)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_newfstatat +SC_TRACE_EVENT(sys_newfstatat, + TP_PROTO(int dfd, const char * filename, struct stat * statbuf, int flag), + TP_ARGS(dfd, filename, statbuf, flag), + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field_hex(struct stat *, statbuf) __field(int, flag)), + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(statbuf, statbuf) tp_assign(flag, flag)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_timerfd_settime +SC_TRACE_EVENT(sys_timerfd_settime, + TP_PROTO(int ufd, int flags, const struct itimerspec * utmr, struct itimerspec * otmr), + TP_ARGS(ufd, flags, utmr, otmr), + TP_STRUCT__entry(__field(int, ufd) __field(int, flags) __field_hex(const struct itimerspec *, utmr) __field_hex(struct itimerspec *, otmr)), + TP_fast_assign(tp_assign(ufd, ufd) tp_assign(flags, flags) tp_assign(utmr, utmr) tp_assign(otmr, otmr)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_utimensat +SC_TRACE_EVENT(sys_utimensat, + TP_PROTO(int dfd, const char * filename, struct timespec * utimes, int flags), + TP_ARGS(dfd, filename, utimes, flags), + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field_hex(struct timespec *, utimes) __field(int, flags)), + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(utimes, utimes) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_timer_settime +SC_TRACE_EVENT(sys_timer_settime, + TP_PROTO(timer_t timer_id, int flags, const struct itimerspec * new_setting, struct itimerspec * old_setting), + TP_ARGS(timer_id, flags, new_setting, old_setting), + TP_STRUCT__entry(__field(timer_t, timer_id) __field(int, flags) __field_hex(const struct itimerspec *, new_setting) __field_hex(struct itimerspec *, old_setting)), + TP_fast_assign(tp_assign(timer_id, timer_id) tp_assign(flags, flags) tp_assign(new_setting, new_setting) tp_assign(old_setting, old_setting)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_clock_nanosleep +SC_TRACE_EVENT(sys_clock_nanosleep, + TP_PROTO(const clockid_t which_clock, int flags, const struct timespec * rqtp, struct timespec * rmtp), + TP_ARGS(which_clock, flags, rqtp, rmtp), + TP_STRUCT__entry(__field(const clockid_t, which_clock) __field(int, flags) __field_hex(const struct timespec *, rqtp) __field_hex(struct timespec *, rmtp)), + TP_fast_assign(tp_assign(which_clock, which_clock) tp_assign(flags, flags) tp_assign(rqtp, rqtp) tp_assign(rmtp, rmtp)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_rt_sigaction +SC_TRACE_EVENT(sys_rt_sigaction, + TP_PROTO(int sig, const struct sigaction * act, struct sigaction * oact, size_t sigsetsize), + TP_ARGS(sig, act, oact, sigsetsize), + TP_STRUCT__entry(__field(int, sig) __field_hex(const struct sigaction *, act) __field_hex(struct sigaction *, oact) __field(size_t, sigsetsize)), + TP_fast_assign(tp_assign(sig, sig) tp_assign(act, act) tp_assign(oact, oact) tp_assign(sigsetsize, sigsetsize)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_rt_sigprocmask +SC_TRACE_EVENT(sys_rt_sigprocmask, + TP_PROTO(int how, sigset_t * nset, sigset_t * oset, size_t sigsetsize), + TP_ARGS(how, nset, oset, sigsetsize), + TP_STRUCT__entry(__field(int, how) __field_hex(sigset_t *, nset) __field_hex(sigset_t *, oset) __field(size_t, sigsetsize)), + TP_fast_assign(tp_assign(how, how) tp_assign(nset, nset) tp_assign(oset, oset) tp_assign(sigsetsize, sigsetsize)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_rt_sigtimedwait +SC_TRACE_EVENT(sys_rt_sigtimedwait, + TP_PROTO(const sigset_t * uthese, siginfo_t * uinfo, const struct timespec * uts, size_t sigsetsize), + TP_ARGS(uthese, uinfo, uts, sigsetsize), + TP_STRUCT__entry(__field_hex(const sigset_t *, uthese) __field_hex(siginfo_t *, uinfo) __field_hex(const struct timespec *, uts) __field(size_t, sigsetsize)), + TP_fast_assign(tp_assign(uthese, uthese) tp_assign(uinfo, uinfo) tp_assign(uts, uts) tp_assign(sigsetsize, sigsetsize)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_reboot +SC_TRACE_EVENT(sys_reboot, + TP_PROTO(int magic1, int magic2, unsigned int cmd, void * arg), + TP_ARGS(magic1, magic2, cmd, arg), + TP_STRUCT__entry(__field(int, magic1) __field(int, magic2) __field(unsigned int, cmd) __field_hex(void *, arg)), + TP_fast_assign(tp_assign(magic1, magic1) tp_assign(magic2, magic2) tp_assign(cmd, cmd) tp_assign(arg, arg)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_mq_open +SC_TRACE_EVENT(sys_mq_open, + TP_PROTO(const char * u_name, int oflag, mode_t mode, struct mq_attr * u_attr), + TP_ARGS(u_name, oflag, mode, u_attr), + TP_STRUCT__entry(__string_from_user(u_name, u_name) __field(int, oflag) __field(mode_t, mode) __field_hex(struct mq_attr *, u_attr)), + TP_fast_assign(tp_copy_string_from_user(u_name, u_name) tp_assign(oflag, oflag) tp_assign(mode, mode) tp_assign(u_attr, u_attr)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_msgsnd +SC_TRACE_EVENT(sys_msgsnd, + TP_PROTO(int msqid, struct msgbuf * msgp, size_t msgsz, int msgflg), + TP_ARGS(msqid, msgp, msgsz, msgflg), + TP_STRUCT__entry(__field(int, msqid) __field_hex(struct msgbuf *, msgp) __field(size_t, msgsz) __field(int, msgflg)), + TP_fast_assign(tp_assign(msqid, msqid) tp_assign(msgp, msgp) tp_assign(msgsz, msgsz) tp_assign(msgflg, msgflg)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_semtimedop +SC_TRACE_EVENT(sys_semtimedop, + TP_PROTO(int semid, struct sembuf * tsops, unsigned nsops, const struct timespec * timeout), + TP_ARGS(semid, tsops, nsops, timeout), + TP_STRUCT__entry(__field(int, semid) __field_hex(struct sembuf *, tsops) __field(unsigned, nsops) __field_hex(const struct timespec *, timeout)), + TP_fast_assign(tp_assign(semid, semid) tp_assign(tsops, tsops) tp_assign(nsops, nsops) tp_assign(timeout, timeout)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_socketpair +SC_TRACE_EVENT(sys_socketpair, + TP_PROTO(int family, int type, int protocol, int * usockvec), + TP_ARGS(family, type, protocol, usockvec), + TP_STRUCT__entry(__field(int, family) __field(int, type) __field(int, protocol) __field_hex(int *, usockvec)), + TP_fast_assign(tp_assign(family, family) tp_assign(type, type) tp_assign(protocol, protocol) tp_assign(usockvec, usockvec)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_request_key +SC_TRACE_EVENT(sys_request_key, + TP_PROTO(const char * _type, const char * _description, const char * _callout_info, key_serial_t destringid), + TP_ARGS(_type, _description, _callout_info, destringid), + TP_STRUCT__entry(__string_from_user(_type, _type) __field_hex(const char *, _description) __field_hex(const char *, _callout_info) __field(key_serial_t, destringid)), + TP_fast_assign(tp_copy_string_from_user(_type, _type) tp_assign(_description, _description) tp_assign(_callout_info, _callout_info) tp_assign(destringid, destringid)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_migrate_pages +SC_TRACE_EVENT(sys_migrate_pages, + TP_PROTO(pid_t pid, unsigned long maxnode, const unsigned long * old_nodes, const unsigned long * new_nodes), + TP_ARGS(pid, maxnode, old_nodes, new_nodes), + TP_STRUCT__entry(__field(pid_t, pid) __field(unsigned long, maxnode) __field_hex(const unsigned long *, old_nodes) __field_hex(const unsigned long *, new_nodes)), + TP_fast_assign(tp_assign(pid, pid) tp_assign(maxnode, maxnode) tp_assign(old_nodes, old_nodes) tp_assign(new_nodes, new_nodes)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_rt_tgsigqueueinfo +SC_TRACE_EVENT(sys_rt_tgsigqueueinfo, + TP_PROTO(pid_t tgid, pid_t pid, int sig, siginfo_t * uinfo), + TP_ARGS(tgid, pid, sig, uinfo), + TP_STRUCT__entry(__field(pid_t, tgid) __field(pid_t, pid) __field(int, sig) __field_hex(siginfo_t *, uinfo)), + TP_fast_assign(tp_assign(tgid, tgid) tp_assign(pid, pid) tp_assign(sig, sig) tp_assign(uinfo, uinfo)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_accept4 +SC_TRACE_EVENT(sys_accept4, + TP_PROTO(int fd, struct sockaddr * upeer_sockaddr, int * upeer_addrlen, int flags), + TP_ARGS(fd, upeer_sockaddr, upeer_addrlen, flags), + TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, upeer_sockaddr) __field_hex(int *, upeer_addrlen) __field(int, flags)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(upeer_sockaddr, upeer_sockaddr) tp_assign(upeer_addrlen, upeer_addrlen) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_wait4 +SC_TRACE_EVENT(sys_wait4, + TP_PROTO(pid_t upid, int * stat_addr, int options, struct rusage * ru), + TP_ARGS(upid, stat_addr, options, ru), + TP_STRUCT__entry(__field(pid_t, upid) __field_hex(int *, stat_addr) __field(int, options) __field_hex(struct rusage *, ru)), + TP_fast_assign(tp_assign(upid, upid) tp_assign(stat_addr, stat_addr) tp_assign(options, options) tp_assign(ru, ru)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_prlimit64 +SC_TRACE_EVENT(sys_prlimit64, + TP_PROTO(pid_t pid, unsigned int resource, const struct rlimit64 * new_rlim, struct rlimit64 * old_rlim), + TP_ARGS(pid, resource, new_rlim, old_rlim), + TP_STRUCT__entry(__field(pid_t, pid) __field(unsigned int, resource) __field_hex(const struct rlimit64 *, new_rlim) __field_hex(struct rlimit64 *, old_rlim)), + TP_fast_assign(tp_assign(pid, pid) tp_assign(resource, resource) tp_assign(new_rlim, new_rlim) tp_assign(old_rlim, old_rlim)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_sendmmsg +SC_TRACE_EVENT(sys_sendmmsg, + TP_PROTO(int fd, struct mmsghdr * mmsg, unsigned int vlen, unsigned int flags), + TP_ARGS(fd, mmsg, vlen, flags), + TP_STRUCT__entry(__field(int, fd) __field_hex(struct mmsghdr *, mmsg) __field(unsigned int, vlen) __field(unsigned int, flags)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(mmsg, mmsg) tp_assign(vlen, vlen) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_io_getevents +SC_TRACE_EVENT(sys_io_getevents, + TP_PROTO(aio_context_t ctx_id, long min_nr, long nr, struct io_event * events, struct timespec * timeout), + TP_ARGS(ctx_id, min_nr, nr, events, timeout), + TP_STRUCT__entry(__field(aio_context_t, ctx_id) __field(long, min_nr) __field(long, nr) __field_hex(struct io_event *, events) __field_hex(struct timespec *, timeout)), + TP_fast_assign(tp_assign(ctx_id, ctx_id) tp_assign(min_nr, min_nr) tp_assign(nr, nr) tp_assign(events, events) tp_assign(timeout, timeout)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_setxattr +SC_TRACE_EVENT(sys_setxattr, + TP_PROTO(const char * pathname, const char * name, const void * value, size_t size, int flags), + TP_ARGS(pathname, name, value, size, flags), + TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name) __field_hex(const void *, value) __field(size_t, size) __field(int, flags)), + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_lsetxattr +SC_TRACE_EVENT(sys_lsetxattr, + TP_PROTO(const char * pathname, const char * name, const void * value, size_t size, int flags), + TP_ARGS(pathname, name, value, size, flags), + TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name) __field_hex(const void *, value) __field(size_t, size) __field(int, flags)), + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_fsetxattr +SC_TRACE_EVENT(sys_fsetxattr, + TP_PROTO(int fd, const char * name, const void * value, size_t size, int flags), + TP_ARGS(fd, name, value, size, flags), + TP_STRUCT__entry(__field(int, fd) __string_from_user(name, name) __field_hex(const void *, value) __field(size_t, size) __field(int, flags)), + TP_fast_assign(tp_assign(fd, fd) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_linkat +SC_TRACE_EVENT(sys_linkat, + TP_PROTO(int olddfd, const char * oldname, int newdfd, const char * newname, int flags), + TP_ARGS(olddfd, oldname, newdfd, newname, flags), + TP_STRUCT__entry(__field(int, olddfd) __string_from_user(oldname, oldname) __field(int, newdfd) __string_from_user(newname, newname) __field(int, flags)), + TP_fast_assign(tp_assign(olddfd, olddfd) tp_copy_string_from_user(oldname, oldname) tp_assign(newdfd, newdfd) tp_copy_string_from_user(newname, newname) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_mount +SC_TRACE_EVENT(sys_mount, + TP_PROTO(char * dev_name, char * dir_name, char * type, unsigned long flags, void * data), + TP_ARGS(dev_name, dir_name, type, flags, data), + TP_STRUCT__entry(__string_from_user(dev_name, dev_name) __string_from_user(dir_name, dir_name) __string_from_user(type, type) __field(unsigned long, flags) __field_hex(void *, data)), + TP_fast_assign(tp_copy_string_from_user(dev_name, dev_name) tp_copy_string_from_user(dir_name, dir_name) tp_copy_string_from_user(type, type) tp_assign(flags, flags) tp_assign(data, data)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_fchownat +SC_TRACE_EVENT(sys_fchownat, + TP_PROTO(int dfd, const char * filename, uid_t user, gid_t group, int flag), + TP_ARGS(dfd, filename, user, group, flag), + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field(uid_t, user) __field(gid_t, group) __field(int, flag)), + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(user, user) tp_assign(group, group) tp_assign(flag, flag)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_preadv +SC_TRACE_EVENT(sys_preadv, + TP_PROTO(unsigned long fd, const struct iovec * vec, unsigned long vlen, unsigned long pos_l, unsigned long pos_h), + TP_ARGS(fd, vec, vlen, pos_l, pos_h), + TP_STRUCT__entry(__field(unsigned long, fd) __field_hex(const struct iovec *, vec) __field(unsigned long, vlen) __field(unsigned long, pos_l) __field(unsigned long, pos_h)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(vec, vec) tp_assign(vlen, vlen) tp_assign(pos_l, pos_l) tp_assign(pos_h, pos_h)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_pwritev +SC_TRACE_EVENT(sys_pwritev, + TP_PROTO(unsigned long fd, const struct iovec * vec, unsigned long vlen, unsigned long pos_l, unsigned long pos_h), + TP_ARGS(fd, vec, vlen, pos_l, pos_h), + TP_STRUCT__entry(__field(unsigned long, fd) __field_hex(const struct iovec *, vec) __field(unsigned long, vlen) __field(unsigned long, pos_l) __field(unsigned long, pos_h)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(vec, vec) tp_assign(vlen, vlen) tp_assign(pos_l, pos_l) tp_assign(pos_h, pos_h)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_ppoll +SC_TRACE_EVENT(sys_ppoll, + TP_PROTO(struct pollfd * ufds, unsigned int nfds, struct timespec * tsp, const sigset_t * sigmask, size_t sigsetsize), + TP_ARGS(ufds, nfds, tsp, sigmask, sigsetsize), + TP_STRUCT__entry(__field_hex(struct pollfd *, ufds) __field(unsigned int, nfds) __field_hex(struct timespec *, tsp) __field_hex(const sigset_t *, sigmask) __field(size_t, sigsetsize)), + TP_fast_assign(tp_assign(ufds, ufds) tp_assign(nfds, nfds) tp_assign(tsp, tsp) tp_assign(sigmask, sigmask) tp_assign(sigsetsize, sigsetsize)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_waitid +SC_TRACE_EVENT(sys_waitid, + TP_PROTO(int which, pid_t upid, struct siginfo * infop, int options, struct rusage * ru), + TP_ARGS(which, upid, infop, options, ru), + TP_STRUCT__entry(__field(int, which) __field(pid_t, upid) __field_hex(struct siginfo *, infop) __field(int, options) __field_hex(struct rusage *, ru)), + TP_fast_assign(tp_assign(which, which) tp_assign(upid, upid) tp_assign(infop, infop) tp_assign(options, options) tp_assign(ru, ru)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_mq_timedsend +SC_TRACE_EVENT(sys_mq_timedsend, + TP_PROTO(mqd_t mqdes, const char * u_msg_ptr, size_t msg_len, unsigned int msg_prio, const struct timespec * u_abs_timeout), + TP_ARGS(mqdes, u_msg_ptr, msg_len, msg_prio, u_abs_timeout), + TP_STRUCT__entry(__field(mqd_t, mqdes) __field_hex(const char *, u_msg_ptr) __field(size_t, msg_len) __field(unsigned int, msg_prio) __field_hex(const struct timespec *, u_abs_timeout)), + TP_fast_assign(tp_assign(mqdes, mqdes) tp_assign(u_msg_ptr, u_msg_ptr) tp_assign(msg_len, msg_len) tp_assign(msg_prio, msg_prio) tp_assign(u_abs_timeout, u_abs_timeout)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_mq_timedreceive +SC_TRACE_EVENT(sys_mq_timedreceive, + TP_PROTO(mqd_t mqdes, char * u_msg_ptr, size_t msg_len, unsigned int * u_msg_prio, const struct timespec * u_abs_timeout), + TP_ARGS(mqdes, u_msg_ptr, msg_len, u_msg_prio, u_abs_timeout), + TP_STRUCT__entry(__field(mqd_t, mqdes) __field_hex(char *, u_msg_ptr) __field(size_t, msg_len) __field_hex(unsigned int *, u_msg_prio) __field_hex(const struct timespec *, u_abs_timeout)), + TP_fast_assign(tp_assign(mqdes, mqdes) tp_assign(u_msg_ptr, u_msg_ptr) tp_assign(msg_len, msg_len) tp_assign(u_msg_prio, u_msg_prio) tp_assign(u_abs_timeout, u_abs_timeout)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_msgrcv +SC_TRACE_EVENT(sys_msgrcv, + TP_PROTO(int msqid, struct msgbuf * msgp, size_t msgsz, long msgtyp, int msgflg), + TP_ARGS(msqid, msgp, msgsz, msgtyp, msgflg), + TP_STRUCT__entry(__field(int, msqid) __field_hex(struct msgbuf *, msgp) __field(size_t, msgsz) __field(long, msgtyp) __field(int, msgflg)), + TP_fast_assign(tp_assign(msqid, msqid) tp_assign(msgp, msgp) tp_assign(msgsz, msgsz) tp_assign(msgtyp, msgtyp) tp_assign(msgflg, msgflg)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_setsockopt +SC_TRACE_EVENT(sys_setsockopt, + TP_PROTO(int fd, int level, int optname, char * optval, int optlen), + TP_ARGS(fd, level, optname, optval, optlen), + TP_STRUCT__entry(__field(int, fd) __field(int, level) __field(int, optname) __field_hex(char *, optval) __field(int, optlen)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(level, level) tp_assign(optname, optname) tp_assign(optval, optval) tp_assign(optlen, optlen)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_getsockopt +SC_TRACE_EVENT(sys_getsockopt, + TP_PROTO(int fd, int level, int optname, char * optval, int * optlen), + TP_ARGS(fd, level, optname, optval, optlen), + TP_STRUCT__entry(__field(int, fd) __field(int, level) __field(int, optname) __field_hex(char *, optval) __field_hex(int *, optlen)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(level, level) tp_assign(optname, optname) tp_assign(optval, optval) tp_assign(optlen, optlen)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_add_key +SC_TRACE_EVENT(sys_add_key, + TP_PROTO(const char * _type, const char * _description, const void * _payload, size_t plen, key_serial_t ringid), + TP_ARGS(_type, _description, _payload, plen, ringid), + TP_STRUCT__entry(__string_from_user(_type, _type) __field_hex(const char *, _description) __field_hex(const void *, _payload) __field(size_t, plen) __field(key_serial_t, ringid)), + TP_fast_assign(tp_copy_string_from_user(_type, _type) tp_assign(_description, _description) tp_assign(_payload, _payload) tp_assign(plen, plen) tp_assign(ringid, ringid)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_get_mempolicy +SC_TRACE_EVENT(sys_get_mempolicy, + TP_PROTO(int * policy, unsigned long * nmask, unsigned long maxnode, unsigned long addr, unsigned long flags), + TP_ARGS(policy, nmask, maxnode, addr, flags), + TP_STRUCT__entry(__field_hex(int *, policy) __field_hex(unsigned long *, nmask) __field(unsigned long, maxnode) __field_hex(unsigned long, addr) __field(unsigned long, flags)), + TP_fast_assign(tp_assign(policy, policy) tp_assign(nmask, nmask) tp_assign(maxnode, maxnode) tp_assign(addr, addr) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_perf_event_open +SC_TRACE_EVENT(sys_perf_event_open, + TP_PROTO(struct perf_event_attr * attr_uptr, pid_t pid, int cpu, int group_fd, unsigned long flags), + TP_ARGS(attr_uptr, pid, cpu, group_fd, flags), + TP_STRUCT__entry(__field_hex(struct perf_event_attr *, attr_uptr) __field(pid_t, pid) __field(int, cpu) __field(int, group_fd) __field(unsigned long, flags)), + TP_fast_assign(tp_assign(attr_uptr, attr_uptr) tp_assign(pid, pid) tp_assign(cpu, cpu) tp_assign(group_fd, group_fd) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_recvmmsg +SC_TRACE_EVENT(sys_recvmmsg, + TP_PROTO(int fd, struct mmsghdr * mmsg, unsigned int vlen, unsigned int flags, struct timespec * timeout), + TP_ARGS(fd, mmsg, vlen, flags, timeout), + TP_STRUCT__entry(__field(int, fd) __field_hex(struct mmsghdr *, mmsg) __field(unsigned int, vlen) __field(unsigned int, flags) __field_hex(struct timespec *, timeout)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(mmsg, mmsg) tp_assign(vlen, vlen) tp_assign(flags, flags) tp_assign(timeout, timeout)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_name_to_handle_at +SC_TRACE_EVENT(sys_name_to_handle_at, + TP_PROTO(int dfd, const char * name, struct file_handle * handle, int * mnt_id, int flag), + TP_ARGS(dfd, name, handle, mnt_id, flag), + TP_STRUCT__entry(__field(int, dfd) __string_from_user(name, name) __field_hex(struct file_handle *, handle) __field_hex(int *, mnt_id) __field(int, flag)), + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(name, name) tp_assign(handle, handle) tp_assign(mnt_id, mnt_id) tp_assign(flag, flag)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_epoll_pwait +SC_TRACE_EVENT(sys_epoll_pwait, + TP_PROTO(int epfd, struct epoll_event * events, int maxevents, int timeout, const sigset_t * sigmask, size_t sigsetsize), + TP_ARGS(epfd, events, maxevents, timeout, sigmask, sigsetsize), + TP_STRUCT__entry(__field(int, epfd) __field_hex(struct epoll_event *, events) __field(int, maxevents) __field(int, timeout) __field_hex(const sigset_t *, sigmask) __field(size_t, sigsetsize)), + TP_fast_assign(tp_assign(epfd, epfd) tp_assign(events, events) tp_assign(maxevents, maxevents) tp_assign(timeout, timeout) tp_assign(sigmask, sigmask) tp_assign(sigsetsize, sigsetsize)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_pselect6 +SC_TRACE_EVENT(sys_pselect6, + TP_PROTO(int n, fd_set * inp, fd_set * outp, fd_set * exp, struct timespec * tsp, void * sig), + TP_ARGS(n, inp, outp, exp, tsp, sig), + TP_STRUCT__entry(__field(int, n) __field_hex(fd_set *, inp) __field_hex(fd_set *, outp) __field_hex(fd_set *, exp) __field_hex(struct timespec *, tsp) __field_hex(void *, sig)), + TP_fast_assign(tp_assign(n, n) tp_assign(inp, inp) tp_assign(outp, outp) tp_assign(exp, exp) tp_assign(tsp, tsp) tp_assign(sig, sig)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_splice +SC_TRACE_EVENT(sys_splice, + TP_PROTO(int fd_in, loff_t * off_in, int fd_out, loff_t * off_out, size_t len, unsigned int flags), + TP_ARGS(fd_in, off_in, fd_out, off_out, len, flags), + TP_STRUCT__entry(__field(int, fd_in) __field_hex(loff_t *, off_in) __field(int, fd_out) __field_hex(loff_t *, off_out) __field(size_t, len) __field(unsigned int, flags)), + TP_fast_assign(tp_assign(fd_in, fd_in) tp_assign(off_in, off_in) tp_assign(fd_out, fd_out) tp_assign(off_out, off_out) tp_assign(len, len) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_futex +SC_TRACE_EVENT(sys_futex, + TP_PROTO(u32 * uaddr, int op, u32 val, struct timespec * utime, u32 * uaddr2, u32 val3), + TP_ARGS(uaddr, op, val, utime, uaddr2, val3), + TP_STRUCT__entry(__field_hex(u32 *, uaddr) __field(int, op) __field(u32, val) __field_hex(struct timespec *, utime) __field_hex(u32 *, uaddr2) __field(u32, val3)), + TP_fast_assign(tp_assign(uaddr, uaddr) tp_assign(op, op) tp_assign(val, val) tp_assign(utime, utime) tp_assign(uaddr2, uaddr2) tp_assign(val3, val3)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_sendto +SC_TRACE_EVENT(sys_sendto, + TP_PROTO(int fd, void * buff, size_t len, unsigned flags, struct sockaddr * addr, int addr_len), + TP_ARGS(fd, buff, len, flags, addr, addr_len), + TP_STRUCT__entry(__field(int, fd) __field_hex(void *, buff) __field(size_t, len) __field(unsigned, flags) __field_hex(struct sockaddr *, addr) __field_hex(int, addr_len)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(buff, buff) tp_assign(len, len) tp_assign(flags, flags) tp_assign(addr, addr) tp_assign(addr_len, addr_len)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_recvfrom +SC_TRACE_EVENT(sys_recvfrom, + TP_PROTO(int fd, void * ubuf, size_t size, unsigned flags, struct sockaddr * addr, int * addr_len), + TP_ARGS(fd, ubuf, size, flags, addr, addr_len), + TP_STRUCT__entry(__field(int, fd) __field_hex(void *, ubuf) __field(size_t, size) __field(unsigned, flags) __field_hex(struct sockaddr *, addr) __field_hex(int *, addr_len)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(ubuf, ubuf) tp_assign(size, size) tp_assign(flags, flags) tp_assign(addr, addr) tp_assign(addr_len, addr_len)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_mbind +SC_TRACE_EVENT(sys_mbind, + TP_PROTO(unsigned long start, unsigned long len, unsigned long mode, unsigned long * nmask, unsigned long maxnode, unsigned flags), + TP_ARGS(start, len, mode, nmask, maxnode, flags), + TP_STRUCT__entry(__field(unsigned long, start) __field(unsigned long, len) __field(unsigned long, mode) __field_hex(unsigned long *, nmask) __field(unsigned long, maxnode) __field(unsigned, flags)), + TP_fast_assign(tp_assign(start, start) tp_assign(len, len) tp_assign(mode, mode) tp_assign(nmask, nmask) tp_assign(maxnode, maxnode) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_64_sys_move_pages +SC_TRACE_EVENT(sys_move_pages, + TP_PROTO(pid_t pid, unsigned long nr_pages, const void * * pages, const int * nodes, int * status, int flags), + TP_ARGS(pid, nr_pages, pages, nodes, status, flags), + TP_STRUCT__entry(__field(pid_t, pid) __field(unsigned long, nr_pages) __field_hex(const void * *, pages) __field_hex(const int *, nodes) __field_hex(int *, status) __field(int, flags)), + TP_fast_assign(tp_assign(pid, pid) tp_assign(nr_pages, nr_pages) tp_assign(pages, pages) tp_assign(nodes, nodes) tp_assign(status, status) tp_assign(flags, flags)), + TP_printk() +) +#endif + +#endif /* _TRACE_SYSCALLS_POINTERS_H */ + +/* This part must be outside protection */ +#include "../../../probes/define_trace.h" + +#else /* CREATE_SYSCALL_TABLE */ + +#include "tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_pointers_override.h" +#include "syscalls_pointers_override.h" + +#ifndef OVERRIDE_TABLE_64_sys_io_setup +TRACE_SYSCALL_TABLE(sys_io_setup, sys_io_setup, 0, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_io_submit +TRACE_SYSCALL_TABLE(sys_io_submit, sys_io_submit, 2, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_io_cancel +TRACE_SYSCALL_TABLE(sys_io_cancel, sys_io_cancel, 3, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_io_getevents +TRACE_SYSCALL_TABLE(sys_io_getevents, sys_io_getevents, 4, 5) +#endif +#ifndef OVERRIDE_TABLE_64_sys_setxattr +TRACE_SYSCALL_TABLE(sys_setxattr, sys_setxattr, 5, 5) +#endif +#ifndef OVERRIDE_TABLE_64_sys_lsetxattr +TRACE_SYSCALL_TABLE(sys_lsetxattr, sys_lsetxattr, 6, 5) +#endif +#ifndef OVERRIDE_TABLE_64_sys_fsetxattr +TRACE_SYSCALL_TABLE(sys_fsetxattr, sys_fsetxattr, 7, 5) +#endif +#ifndef OVERRIDE_TABLE_64_sys_getxattr +TRACE_SYSCALL_TABLE(sys_getxattr, sys_getxattr, 8, 4) +#endif +#ifndef OVERRIDE_TABLE_64_sys_lgetxattr +TRACE_SYSCALL_TABLE(sys_lgetxattr, sys_lgetxattr, 9, 4) +#endif +#ifndef OVERRIDE_TABLE_64_sys_fgetxattr +TRACE_SYSCALL_TABLE(sys_fgetxattr, sys_fgetxattr, 10, 4) +#endif +#ifndef OVERRIDE_TABLE_64_sys_listxattr +TRACE_SYSCALL_TABLE(sys_listxattr, sys_listxattr, 11, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_llistxattr +TRACE_SYSCALL_TABLE(sys_llistxattr, sys_llistxattr, 12, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_flistxattr +TRACE_SYSCALL_TABLE(sys_flistxattr, sys_flistxattr, 13, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_removexattr +TRACE_SYSCALL_TABLE(sys_removexattr, sys_removexattr, 14, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_lremovexattr +TRACE_SYSCALL_TABLE(sys_lremovexattr, sys_lremovexattr, 15, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_fremovexattr +TRACE_SYSCALL_TABLE(sys_fremovexattr, sys_fremovexattr, 16, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_getcwd +TRACE_SYSCALL_TABLE(sys_getcwd, sys_getcwd, 17, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_epoll_ctl +TRACE_SYSCALL_TABLE(sys_epoll_ctl, sys_epoll_ctl, 21, 4) +#endif +#ifndef OVERRIDE_TABLE_64_sys_epoll_pwait +TRACE_SYSCALL_TABLE(sys_epoll_pwait, sys_epoll_pwait, 22, 6) +#endif +#ifndef OVERRIDE_TABLE_64_sys_inotify_add_watch +TRACE_SYSCALL_TABLE(sys_inotify_add_watch, sys_inotify_add_watch, 27, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_mknodat +TRACE_SYSCALL_TABLE(sys_mknodat, sys_mknodat, 33, 4) +#endif +#ifndef OVERRIDE_TABLE_64_sys_mkdirat +TRACE_SYSCALL_TABLE(sys_mkdirat, sys_mkdirat, 34, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_unlinkat +TRACE_SYSCALL_TABLE(sys_unlinkat, sys_unlinkat, 35, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_symlinkat +TRACE_SYSCALL_TABLE(sys_symlinkat, sys_symlinkat, 36, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_linkat +TRACE_SYSCALL_TABLE(sys_linkat, sys_linkat, 37, 5) +#endif +#ifndef OVERRIDE_TABLE_64_sys_renameat +TRACE_SYSCALL_TABLE(sys_renameat, sys_renameat, 38, 4) +#endif +#ifndef OVERRIDE_TABLE_64_sys_umount +TRACE_SYSCALL_TABLE(sys_umount, sys_umount, 39, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_mount +TRACE_SYSCALL_TABLE(sys_mount, sys_mount, 40, 5) +#endif +#ifndef OVERRIDE_TABLE_64_sys_pivot_root +TRACE_SYSCALL_TABLE(sys_pivot_root, sys_pivot_root, 41, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_nfsservctl +TRACE_SYSCALL_TABLE(sys_nfsservctl, sys_nfsservctl, 42, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_statfs +TRACE_SYSCALL_TABLE(sys_statfs, sys_statfs, 43, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_fstatfs +TRACE_SYSCALL_TABLE(sys_fstatfs, sys_fstatfs, 44, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_truncate +TRACE_SYSCALL_TABLE(sys_truncate, sys_truncate, 45, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_faccessat +TRACE_SYSCALL_TABLE(sys_faccessat, sys_faccessat, 48, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_chdir +TRACE_SYSCALL_TABLE(sys_chdir, sys_chdir, 49, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_chroot +TRACE_SYSCALL_TABLE(sys_chroot, sys_chroot, 51, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_fchmodat +TRACE_SYSCALL_TABLE(sys_fchmodat, sys_fchmodat, 53, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_fchownat +TRACE_SYSCALL_TABLE(sys_fchownat, sys_fchownat, 54, 5) +#endif +#ifndef OVERRIDE_TABLE_64_sys_openat +TRACE_SYSCALL_TABLE(sys_openat, sys_openat, 56, 4) +#endif +#ifndef OVERRIDE_TABLE_64_sys_pipe2 +TRACE_SYSCALL_TABLE(sys_pipe2, sys_pipe2, 59, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_quotactl +TRACE_SYSCALL_TABLE(sys_quotactl, sys_quotactl, 60, 4) +#endif +#ifndef OVERRIDE_TABLE_64_sys_getdents64 +TRACE_SYSCALL_TABLE(sys_getdents64, sys_getdents64, 61, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_read +TRACE_SYSCALL_TABLE(sys_read, sys_read, 63, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_write +TRACE_SYSCALL_TABLE(sys_write, sys_write, 64, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_readv +TRACE_SYSCALL_TABLE(sys_readv, sys_readv, 65, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_writev +TRACE_SYSCALL_TABLE(sys_writev, sys_writev, 66, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_preadv +TRACE_SYSCALL_TABLE(sys_preadv, sys_preadv, 69, 5) +#endif +#ifndef OVERRIDE_TABLE_64_sys_pwritev +TRACE_SYSCALL_TABLE(sys_pwritev, sys_pwritev, 70, 5) +#endif +#ifndef OVERRIDE_TABLE_64_sys_sendfile64 +TRACE_SYSCALL_TABLE(sys_sendfile64, sys_sendfile64, 71, 4) +#endif +#ifndef OVERRIDE_TABLE_64_sys_pselect6 +TRACE_SYSCALL_TABLE(sys_pselect6, sys_pselect6, 72, 6) +#endif +#ifndef OVERRIDE_TABLE_64_sys_ppoll +TRACE_SYSCALL_TABLE(sys_ppoll, sys_ppoll, 73, 5) +#endif +#ifndef OVERRIDE_TABLE_64_sys_signalfd4 +TRACE_SYSCALL_TABLE(sys_signalfd4, sys_signalfd4, 74, 4) +#endif +#ifndef OVERRIDE_TABLE_64_sys_vmsplice +TRACE_SYSCALL_TABLE(sys_vmsplice, sys_vmsplice, 75, 4) +#endif +#ifndef OVERRIDE_TABLE_64_sys_splice +TRACE_SYSCALL_TABLE(sys_splice, sys_splice, 76, 6) +#endif +#ifndef OVERRIDE_TABLE_64_sys_readlinkat +TRACE_SYSCALL_TABLE(sys_readlinkat, sys_readlinkat, 78, 4) +#endif +#ifndef OVERRIDE_TABLE_64_sys_newfstatat +TRACE_SYSCALL_TABLE(sys_newfstatat, sys_newfstatat, 79, 4) +#endif +#ifndef OVERRIDE_TABLE_64_sys_newfstat +TRACE_SYSCALL_TABLE(sys_newfstat, sys_newfstat, 80, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_timerfd_settime +TRACE_SYSCALL_TABLE(sys_timerfd_settime, sys_timerfd_settime, 86, 4) +#endif +#ifndef OVERRIDE_TABLE_64_sys_timerfd_gettime +TRACE_SYSCALL_TABLE(sys_timerfd_gettime, sys_timerfd_gettime, 87, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_utimensat +TRACE_SYSCALL_TABLE(sys_utimensat, sys_utimensat, 88, 4) +#endif +#ifndef OVERRIDE_TABLE_64_sys_acct +TRACE_SYSCALL_TABLE(sys_acct, sys_acct, 89, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_waitid +TRACE_SYSCALL_TABLE(sys_waitid, sys_waitid, 95, 5) +#endif +#ifndef OVERRIDE_TABLE_64_sys_set_tid_address +TRACE_SYSCALL_TABLE(sys_set_tid_address, sys_set_tid_address, 96, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_futex +TRACE_SYSCALL_TABLE(sys_futex, sys_futex, 98, 6) +#endif +#ifndef OVERRIDE_TABLE_64_sys_set_robust_list +TRACE_SYSCALL_TABLE(sys_set_robust_list, sys_set_robust_list, 99, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_get_robust_list +TRACE_SYSCALL_TABLE(sys_get_robust_list, sys_get_robust_list, 100, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_nanosleep +TRACE_SYSCALL_TABLE(sys_nanosleep, sys_nanosleep, 101, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_getitimer +TRACE_SYSCALL_TABLE(sys_getitimer, sys_getitimer, 102, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_setitimer +TRACE_SYSCALL_TABLE(sys_setitimer, sys_setitimer, 103, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_init_module +TRACE_SYSCALL_TABLE(sys_init_module, sys_init_module, 105, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_delete_module +TRACE_SYSCALL_TABLE(sys_delete_module, sys_delete_module, 106, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_timer_create +TRACE_SYSCALL_TABLE(sys_timer_create, sys_timer_create, 107, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_timer_gettime +TRACE_SYSCALL_TABLE(sys_timer_gettime, sys_timer_gettime, 108, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_timer_settime +TRACE_SYSCALL_TABLE(sys_timer_settime, sys_timer_settime, 110, 4) +#endif +#ifndef OVERRIDE_TABLE_64_sys_clock_settime +TRACE_SYSCALL_TABLE(sys_clock_settime, sys_clock_settime, 112, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_clock_gettime +TRACE_SYSCALL_TABLE(sys_clock_gettime, sys_clock_gettime, 113, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_clock_getres +TRACE_SYSCALL_TABLE(sys_clock_getres, sys_clock_getres, 114, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_clock_nanosleep +TRACE_SYSCALL_TABLE(sys_clock_nanosleep, sys_clock_nanosleep, 115, 4) +#endif +#ifndef OVERRIDE_TABLE_64_sys_syslog +TRACE_SYSCALL_TABLE(sys_syslog, sys_syslog, 116, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_sched_setparam +TRACE_SYSCALL_TABLE(sys_sched_setparam, sys_sched_setparam, 118, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_sched_setscheduler +TRACE_SYSCALL_TABLE(sys_sched_setscheduler, sys_sched_setscheduler, 119, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_sched_getparam +TRACE_SYSCALL_TABLE(sys_sched_getparam, sys_sched_getparam, 121, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_sched_setaffinity +TRACE_SYSCALL_TABLE(sys_sched_setaffinity, sys_sched_setaffinity, 122, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_sched_getaffinity +TRACE_SYSCALL_TABLE(sys_sched_getaffinity, sys_sched_getaffinity, 123, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_sched_rr_get_interval +TRACE_SYSCALL_TABLE(sys_sched_rr_get_interval, sys_sched_rr_get_interval, 127, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_rt_sigsuspend +TRACE_SYSCALL_TABLE(sys_rt_sigsuspend, sys_rt_sigsuspend, 133, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_rt_sigaction +TRACE_SYSCALL_TABLE(sys_rt_sigaction, sys_rt_sigaction, 134, 4) +#endif +#ifndef OVERRIDE_TABLE_64_sys_rt_sigprocmask +TRACE_SYSCALL_TABLE(sys_rt_sigprocmask, sys_rt_sigprocmask, 135, 4) +#endif +#ifndef OVERRIDE_TABLE_64_sys_rt_sigpending +TRACE_SYSCALL_TABLE(sys_rt_sigpending, sys_rt_sigpending, 136, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_rt_sigtimedwait +TRACE_SYSCALL_TABLE(sys_rt_sigtimedwait, sys_rt_sigtimedwait, 137, 4) +#endif +#ifndef OVERRIDE_TABLE_64_sys_rt_sigqueueinfo +TRACE_SYSCALL_TABLE(sys_rt_sigqueueinfo, sys_rt_sigqueueinfo, 138, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_reboot +TRACE_SYSCALL_TABLE(sys_reboot, sys_reboot, 142, 4) +#endif +#ifndef OVERRIDE_TABLE_64_sys_getresuid +TRACE_SYSCALL_TABLE(sys_getresuid, sys_getresuid, 148, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_getresgid +TRACE_SYSCALL_TABLE(sys_getresgid, sys_getresgid, 150, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_times +TRACE_SYSCALL_TABLE(sys_times, sys_times, 153, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_getgroups +TRACE_SYSCALL_TABLE(sys_getgroups, sys_getgroups, 158, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_setgroups +TRACE_SYSCALL_TABLE(sys_setgroups, sys_setgroups, 159, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_newuname +TRACE_SYSCALL_TABLE(sys_newuname, sys_newuname, 160, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_sethostname +TRACE_SYSCALL_TABLE(sys_sethostname, sys_sethostname, 161, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_setdomainname +TRACE_SYSCALL_TABLE(sys_setdomainname, sys_setdomainname, 162, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_getrlimit +TRACE_SYSCALL_TABLE(sys_getrlimit, sys_getrlimit, 163, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_setrlimit +TRACE_SYSCALL_TABLE(sys_setrlimit, sys_setrlimit, 164, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_getrusage +TRACE_SYSCALL_TABLE(sys_getrusage, sys_getrusage, 165, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_getcpu +TRACE_SYSCALL_TABLE(sys_getcpu, sys_getcpu, 168, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_gettimeofday +TRACE_SYSCALL_TABLE(sys_gettimeofday, sys_gettimeofday, 169, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_settimeofday +TRACE_SYSCALL_TABLE(sys_settimeofday, sys_settimeofday, 170, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_adjtimex +TRACE_SYSCALL_TABLE(sys_adjtimex, sys_adjtimex, 171, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_sysinfo +TRACE_SYSCALL_TABLE(sys_sysinfo, sys_sysinfo, 179, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_mq_open +TRACE_SYSCALL_TABLE(sys_mq_open, sys_mq_open, 180, 4) +#endif +#ifndef OVERRIDE_TABLE_64_sys_mq_unlink +TRACE_SYSCALL_TABLE(sys_mq_unlink, sys_mq_unlink, 181, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_mq_timedsend +TRACE_SYSCALL_TABLE(sys_mq_timedsend, sys_mq_timedsend, 182, 5) +#endif +#ifndef OVERRIDE_TABLE_64_sys_mq_timedreceive +TRACE_SYSCALL_TABLE(sys_mq_timedreceive, sys_mq_timedreceive, 183, 5) +#endif +#ifndef OVERRIDE_TABLE_64_sys_mq_notify +TRACE_SYSCALL_TABLE(sys_mq_notify, sys_mq_notify, 184, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_mq_getsetattr +TRACE_SYSCALL_TABLE(sys_mq_getsetattr, sys_mq_getsetattr, 185, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_msgctl +TRACE_SYSCALL_TABLE(sys_msgctl, sys_msgctl, 187, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_msgrcv +TRACE_SYSCALL_TABLE(sys_msgrcv, sys_msgrcv, 188, 5) +#endif +#ifndef OVERRIDE_TABLE_64_sys_msgsnd +TRACE_SYSCALL_TABLE(sys_msgsnd, sys_msgsnd, 189, 4) +#endif +#ifndef OVERRIDE_TABLE_64_sys_semtimedop +TRACE_SYSCALL_TABLE(sys_semtimedop, sys_semtimedop, 192, 4) +#endif +#ifndef OVERRIDE_TABLE_64_sys_semop +TRACE_SYSCALL_TABLE(sys_semop, sys_semop, 193, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_shmctl +TRACE_SYSCALL_TABLE(sys_shmctl, sys_shmctl, 195, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_shmat +TRACE_SYSCALL_TABLE(sys_shmat, sys_shmat, 196, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_shmdt +TRACE_SYSCALL_TABLE(sys_shmdt, sys_shmdt, 197, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_socketpair +TRACE_SYSCALL_TABLE(sys_socketpair, sys_socketpair, 199, 4) +#endif +#ifndef OVERRIDE_TABLE_64_sys_bind +TRACE_SYSCALL_TABLE(sys_bind, sys_bind, 200, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_accept +TRACE_SYSCALL_TABLE(sys_accept, sys_accept, 202, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_connect +TRACE_SYSCALL_TABLE(sys_connect, sys_connect, 203, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_getsockname +TRACE_SYSCALL_TABLE(sys_getsockname, sys_getsockname, 204, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_getpeername +TRACE_SYSCALL_TABLE(sys_getpeername, sys_getpeername, 205, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_sendto +TRACE_SYSCALL_TABLE(sys_sendto, sys_sendto, 206, 6) +#endif +#ifndef OVERRIDE_TABLE_64_sys_recvfrom +TRACE_SYSCALL_TABLE(sys_recvfrom, sys_recvfrom, 207, 6) +#endif +#ifndef OVERRIDE_TABLE_64_sys_setsockopt +TRACE_SYSCALL_TABLE(sys_setsockopt, sys_setsockopt, 208, 5) +#endif +#ifndef OVERRIDE_TABLE_64_sys_getsockopt +TRACE_SYSCALL_TABLE(sys_getsockopt, sys_getsockopt, 209, 5) +#endif +#ifndef OVERRIDE_TABLE_64_sys_sendmsg +TRACE_SYSCALL_TABLE(sys_sendmsg, sys_sendmsg, 211, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_recvmsg +TRACE_SYSCALL_TABLE(sys_recvmsg, sys_recvmsg, 212, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_add_key +TRACE_SYSCALL_TABLE(sys_add_key, sys_add_key, 217, 5) +#endif +#ifndef OVERRIDE_TABLE_64_sys_request_key +TRACE_SYSCALL_TABLE(sys_request_key, sys_request_key, 218, 4) +#endif +#ifndef OVERRIDE_TABLE_64_sys_swapon +TRACE_SYSCALL_TABLE(sys_swapon, sys_swapon, 224, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_swapoff +TRACE_SYSCALL_TABLE(sys_swapoff, sys_swapoff, 225, 1) +#endif +#ifndef OVERRIDE_TABLE_64_sys_mincore +TRACE_SYSCALL_TABLE(sys_mincore, sys_mincore, 232, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_mbind +TRACE_SYSCALL_TABLE(sys_mbind, sys_mbind, 235, 6) +#endif +#ifndef OVERRIDE_TABLE_64_sys_get_mempolicy +TRACE_SYSCALL_TABLE(sys_get_mempolicy, sys_get_mempolicy, 236, 5) +#endif +#ifndef OVERRIDE_TABLE_64_sys_set_mempolicy +TRACE_SYSCALL_TABLE(sys_set_mempolicy, sys_set_mempolicy, 237, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_migrate_pages +TRACE_SYSCALL_TABLE(sys_migrate_pages, sys_migrate_pages, 238, 4) +#endif +#ifndef OVERRIDE_TABLE_64_sys_move_pages +TRACE_SYSCALL_TABLE(sys_move_pages, sys_move_pages, 239, 6) +#endif +#ifndef OVERRIDE_TABLE_64_sys_rt_tgsigqueueinfo +TRACE_SYSCALL_TABLE(sys_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo, 240, 4) +#endif +#ifndef OVERRIDE_TABLE_64_sys_perf_event_open +TRACE_SYSCALL_TABLE(sys_perf_event_open, sys_perf_event_open, 241, 5) +#endif +#ifndef OVERRIDE_TABLE_64_sys_accept4 +TRACE_SYSCALL_TABLE(sys_accept4, sys_accept4, 242, 4) +#endif +#ifndef OVERRIDE_TABLE_64_sys_recvmmsg +TRACE_SYSCALL_TABLE(sys_recvmmsg, sys_recvmmsg, 243, 5) +#endif +#ifndef OVERRIDE_TABLE_64_sys_wait4 +TRACE_SYSCALL_TABLE(sys_wait4, sys_wait4, 260, 4) +#endif +#ifndef OVERRIDE_TABLE_64_sys_prlimit64 +TRACE_SYSCALL_TABLE(sys_prlimit64, sys_prlimit64, 261, 4) +#endif +#ifndef OVERRIDE_TABLE_64_sys_name_to_handle_at +TRACE_SYSCALL_TABLE(sys_name_to_handle_at, sys_name_to_handle_at, 264, 5) +#endif +#ifndef OVERRIDE_TABLE_64_sys_open_by_handle_at +TRACE_SYSCALL_TABLE(sys_open_by_handle_at, sys_open_by_handle_at, 265, 3) +#endif +#ifndef OVERRIDE_TABLE_64_sys_clock_adjtime +TRACE_SYSCALL_TABLE(sys_clock_adjtime, sys_clock_adjtime, 266, 2) +#endif +#ifndef OVERRIDE_TABLE_64_sys_sendmmsg +TRACE_SYSCALL_TABLE(sys_sendmmsg, sys_sendmmsg, 269, 4) +#endif + +#endif /* CREATE_SYSCALL_TABLE */ diff --git a/instrumentation/syscalls/headers/tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_pointers_override.h b/instrumentation/syscalls/headers/tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_pointers_override.h new file mode 100644 index 0000000..e5f402c --- /dev/null +++ b/instrumentation/syscalls/headers/tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_pointers_override.h @@ -0,0 +1,14 @@ +#define OVERRIDE_TABLE_64_sys_execve +#define OVERRIDE_TABLE_64_sys_clone + +#ifndef CREATE_SYSCALL_TABLE + +#else /* CREATE_SYSCALL_TABLE */ + +#define OVERRIDE_TABLE_64_sys_execve +TRACE_SYSCALL_TABLE(sys_execve, sys_execve, 221, 3) + +#define OVERRIDE_TABLE_64_sys_clone +TRACE_SYSCALL_TABLE(sys_clone, sys_clone, 220, 4) + +#endif /* CREATE_SYSCALL_TABLE */ -- 1.7.1 From zylthinking at gmail.com Thu Feb 7 05:02:14 2013 From: zylthinking at gmail.com (=?UTF-8?B?6LW15a6H6b6Z?=) Date: Thu, 7 Feb 2013 18:02:14 +0800 Subject: [lttng-dev] my user space rcu code Message-ID: Hi, I write a user space rcu, code at https://github.com/zylthinking/tools/blob/master/rcu.h https://github.com/zylthinking/tools/blob/master/rcu.c. I notice the main difference with liburcu should be I use a daemon thread to do works such as waking up sleepers, while the liburcu does not. I wonder why we can't use such a thread. When we use it, the rcu_read_(un)lock will not includes wake up writers any more. which will help to improve performance. It is the cost of such a daemon thread is too high? zhao yulong -------------- next part -------------- An HTML attachment was scrubbed... URL: From mathieu.desnoyers at efficios.com Thu Feb 7 11:20:51 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 7 Feb 2013 11:20:51 -0500 Subject: [lttng-dev] my user space rcu code In-Reply-To: References: Message-ID: <20130207162051.GA5538@Krystal> * ??? (zylthinking at gmail.com) wrote: > Hi, > > I write a user space rcu, code at > https://github.com/zylthinking/tools/blob/master/rcu.h > https://github.com/zylthinking/tools/blob/master/rcu.c. > > I notice the main difference with liburcu should be I use a daemon thread > to do works such as waking up sleepers, while the liburcu does not. > > I wonder why we can't use such a thread. When we use it, the > rcu_read_(un)lock will not includes wake up writers any more. which will > help to improve performance. It is the cost of such a daemon thread is too > high? > > zhao yulong Hi Zhao, The main reason for having the "wakeup writer" present in the rcu_read_unlock() path in liburcu is to be energy-efficient: we don't want any thread to consume power unless they really have to. For instance, endless busy-waiting on a variable is avoided. This is why we rely on sys_futex to wake up awaiting writers from rcu_read_unlock(). AFAIU, your rcu_daemon() thread is always active, and even though it calls "sched_yield()" to be nice to others, it will keep one CPU always powered on. One important thing to notice is that liburcu rcu_read_unlock() only calls sys_futex if a writer is waiting. Therefore, in a scenario with frequent reads and infrequent updates, rcu_read_unlock() only has to take the performance overhead of a load, test and branch, actually skipping the futex wake call. Another reason for not going for a worker thread to handle wait/wakeup between synchronize_rcu and rcu_read_unlock is to minimize impact on the application process/threading model. This is especially true for applications that rely on fork() _not_ followed by exec(): Linux actually copies a single thread of the parent (the one executing fork()), and discards all other threads. Therefore, we must be aware that adding an in-library thread will require users to handle the fork()-not-followed-by-exec() case carefully. Since we had no other choice, we rely on worker threads for call_rcu, but we don't use worker threads for the "simpler" use-case of synchronize_rcu(). A third reason for directly waking up the writer thread rather than having a worker thread dispatching this information is speed. Given the power efficiency constraints expressed above, we would have to issue one system call from the rcu_read_unlock() site to wake up the rcu_daemon() thread (so it does not have to busy-wait), and another system call to wake up the writer, involving a third thread in what should really involve only two threads. This will therefore add overhead to this signalling by requiring the scheduler to perform one extra context switch, and may involve extra communication between processors, since rcu_daemon() will likely execute on a different CPU, and will have to bring in cache lines from other processors. Finally, let's discuss the real-time aspect. For RT, we ideally want wait-free rcu_read_lock/unlock. Indeed, having a sys_futex wakeup call in rcu_read_unlock() could arguably be seen a making the unlock path less strictly wait-free (in case you would be concerned about the internal implementation of sys_futex wake not being entirely wait-free). Currently, on Linux, one way to change the behavior of rcu_read_unlock() to make it even more RT-friendly (in case you are concerned about using sys_futex() on a pure RT thread) is to undefine CONFIG_RCU_HAVE_FUTEX, thus changing the behavior of urcu/futex.h and compat_futex.c. The futex_async() call will then do busy-waiting on the FUTEX_WAIT side (waiting 10us between attempts), and do exactly _nothing_ on the wake-up side, which is certainly wait-free. This will be less energy-efficient, of course, but will provide a strictly wait-free rcu_read_unlock(). We might want to consider creating a liburcu-rt.so for real-time use-cases that prefer the non-energy-efficient wait, along with the strictly wait-free rcu_read_unlock(). Thoughts ? Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Thu Feb 7 12:17:06 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 7 Feb 2013 12:17:06 -0500 Subject: [lttng-dev] my user space rcu code In-Reply-To: <20130207162051.GA5538@Krystal> References: <20130207162051.GA5538@Krystal> Message-ID: <20130207171706.GA6398@Krystal> * Mathieu Desnoyers (mathieu.desnoyers at efficios.com) wrote: > * ??? (zylthinking at gmail.com) wrote: > > Hi, > > > > I write a user space rcu, code at > > https://github.com/zylthinking/tools/blob/master/rcu.h > > https://github.com/zylthinking/tools/blob/master/rcu.c. > > > > I notice the main difference with liburcu should be I use a daemon thread > > to do works such as waking up sleepers, while the liburcu does not. > > > > I wonder why we can't use such a thread. When we use it, the > > rcu_read_(un)lock will not includes wake up writers any more. which will > > help to improve performance. It is the cost of such a daemon thread is too > > high? > > > > zhao yulong > > Hi Zhao, > > The main reason for having the "wakeup writer" present in the > rcu_read_unlock() path in liburcu is to be energy-efficient: we don't > want any thread to consume power unless they really have to. For > instance, endless busy-waiting on a variable is avoided. > > This is why we rely on sys_futex to wake up awaiting writers from > rcu_read_unlock(). AFAIU, your rcu_daemon() thread is always active, and > even though it calls "sched_yield()" to be nice to others, it will keep > one CPU always powered on. > > One important thing to notice is that liburcu rcu_read_unlock() only > calls sys_futex if a writer is waiting. Therefore, in a scenario with > frequent reads and infrequent updates, rcu_read_unlock() only has to > take the performance overhead of a load, test and branch, actually > skipping the futex wake call. > > Another reason for not going for a worker thread to handle wait/wakeup > between synchronize_rcu and rcu_read_unlock is to minimize impact on the > application process/threading model. This is especially true for > applications that rely on fork() _not_ followed by exec(): Linux > actually copies a single thread of the parent (the one executing > fork()), and discards all other threads. Therefore, we must be aware > that adding an in-library thread will require users to handle the > fork()-not-followed-by-exec() case carefully. Since we had no other > choice, we rely on worker threads for call_rcu, but we don't use worker > threads for the "simpler" use-case of synchronize_rcu(). > > A third reason for directly waking up the writer thread rather than > having a worker thread dispatching this information is speed. Given the > power efficiency constraints expressed above, we would have to issue one > system call from the rcu_read_unlock() site to wake up the rcu_daemon() > thread (so it does not have to busy-wait), and another system call to > wake up the writer, involving a third thread in what should really > involve only two threads. This will therefore add overhead to this > signalling by requiring the scheduler to perform one extra context > switch, and may involve extra communication between processors, since > rcu_daemon() will likely execute on a different CPU, and will have to > bring in cache lines from other processors. > > Finally, let's discuss the real-time aspect. For RT, we ideally want > wait-free rcu_read_lock/unlock. Indeed, having a sys_futex wakeup call > in rcu_read_unlock() could arguably be seen a making the unlock path > less strictly wait-free (in case you would be concerned about the > internal implementation of sys_futex wake not being entirely wait-free). > Currently, on Linux, one way to change the behavior of rcu_read_unlock() > to make it even more RT-friendly (in case you are concerned about using > sys_futex() on a pure RT thread) is to undefine CONFIG_RCU_HAVE_FUTEX, > thus changing the behavior of urcu/futex.h and compat_futex.c. The > futex_async() call will then do busy-waiting on the FUTEX_WAIT side > (waiting 10us between attempts), and do exactly _nothing_ on the wake-up sorry, I meant 10ms rather than 10us. Thanks, Mathieu > side, which is certainly wait-free. This will be less energy-efficient, > of course, but will provide a strictly wait-free rcu_read_unlock(). > > We might want to consider creating a liburcu-rt.so for real-time > use-cases that prefer the non-energy-efficient wait, along with the > strictly wait-free rcu_read_unlock(). Thoughts ? > > Thanks, > > Mathieu > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From jeremie.galarneau at efficios.com Thu Feb 7 12:25:24 2013 From: jeremie.galarneau at efficios.com (=?UTF-8?q?J=C3=A9r=C3=A9mie=20Galarneau?=) Date: Thu, 7 Feb 2013 12:25:24 -0500 Subject: [lttng-dev] [PATCH babeltrace 1/1] Converted the unit tests to the TAP format and moved the bitfield test Message-ID: <1360257924-7460-1-git-send-email-jeremie.galarneau@efficios.com> Signed-off-by: J?r?mie Galarneau --- tests/Makefile.am | 4 - tests/lib/Makefile.am | 7 +- tests/lib/runall.sh | 5 +- tests/lib/test-bitfield.c | 331 +++++++++++++++++++++++++++++++++++++++++ tests/lib/test-seeks.c | 1 - tests/runall.sh | 97 +++++------- tests/test-bitfield.c | 371 ---------------------------------------------- 7 files changed, 379 insertions(+), 437 deletions(-) create mode 100644 tests/lib/test-bitfield.c delete mode 100644 tests/test-bitfield.c diff --git a/tests/Makefile.am b/tests/Makefile.am index 47891e9..816fa66 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -2,10 +2,6 @@ AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include SUBDIRS = lib -noinst_PROGRAMS = test-bitfield - -test_bitfield_SOURCES = test-bitfield.c - EXTRA_DIST = runall.sh ctf-traces/** check-am: diff --git a/tests/lib/Makefile.am b/tests/lib/Makefile.am index e9e264b..1e3d80f 100644 --- a/tests/lib/Makefile.am +++ b/tests/lib/Makefile.am @@ -8,9 +8,14 @@ test_seeks_LDADD = libtestcommon.a \ $(top_builddir)/lib/libbabeltrace.la \ $(top_builddir)/formats/ctf/libbabeltrace-ctf.la -noinst_PROGRAMS = test-seeks +test_bitfield_LDADD = libtestcommon.a \ + $(top_builddir)/lib/libbabeltrace.la \ + $(top_builddir)/formats/ctf/libbabeltrace-ctf.la + +noinst_PROGRAMS = test-seeks test-bitfield test_seeks_SOURCES = test-seeks.c +test_bitfield_SOURCES = test-bitfield.c EXTRA_DIST = README.tap runall.sh diff --git a/tests/lib/runall.sh b/tests/lib/runall.sh index 34503bb..b5522ad 100755 --- a/tests/lib/runall.sh +++ b/tests/lib/runall.sh @@ -3,4 +3,7 @@ # With a trace than contains empty packets ./test-seeks ../ctf-traces/succeed/wk-heartbeat-u/ 1351532897586558519 1351532897591331194 # With a bigger trace -./test-seeks ../ctf-traces/succeed/lttng-modules-2.0-pre5/ 61334174524234 61336381998396 \ No newline at end of file +./test-seeks ../ctf-traces/succeed/lttng-modules-2.0-pre5/ 61334174524234 61336381998396 + +# run bitfield tests +./test-bitfield diff --git a/tests/lib/test-bitfield.c b/tests/lib/test-bitfield.c new file mode 100644 index 0000000..58f0b5e --- /dev/null +++ b/tests/lib/test-bitfield.c @@ -0,0 +1,331 @@ +/* + * test-bitfield.c + * + * BabelTrace - bitfield test program + * + * Copyright 2010 - Mathieu Desnoyers + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; under version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#define _GNU_SOURCE +#include +#include +#include +#include +#include + +#include "tap.h" + +unsigned int glob; + +/* + * This function is only declared to show the size of a bitfield write in + * objdump. + */ +void fct(void) +{ + bt_bitfield_write(&glob, unsigned int, 12, 15, 0x12345678); +} + +/* Test array size, in bytes */ +#define TEST_LEN 128 +#define NR_TESTS 10 +#define TYPES_CNT 5 + +unsigned int srcrand; + +#if defined(__i386) || defined(__x86_64) + +static inline int fls(int x) +{ + int r; + asm("bsrl %1,%0\n\t" + "cmovzl %2,%0" + : "=&r" (r) : "rm" (x), "rm" (-1)); + return r + 1; +} + +#elif defined(__PPC__) + +static __inline__ int fls(unsigned int x) +{ + int lz; + + asm ("cntlzw %0,%1" : "=r" (lz) : "r" (x)); + return 32 - lz; +} + +#else + +static int fls(unsigned int x) +{ + int r = 32; + + if (!x) + return 0; + if (!(x & 0xFFFF0000U)) { + x <<= 16; + r -= 16; + } + if (!(x & 0xFF000000U)) { + x <<= 8; + r -= 8; + } + if (!(x & 0xF0000000U)) { + x <<= 4; + r -= 4; + } + if (!(x & 0xC0000000U)) { + x <<= 2; + r -= 2; + } + if (!(x & 0x80000000U)) { + x <<= 1; + r -= 1; + } + return r; +} + +#endif + +#define print_byte_array(c, len) \ +do { \ + unsigned long i; \ + \ + for (i = 0; i < (len); i++) { \ + printf("0x%X", (c)[i]); \ + if (i != (len) - 1) \ + printf(" "); \ + } \ + printf("\n"); \ +} while (0) + +#define init_byte_array(c, len, val) \ +do { \ + unsigned long i; \ + \ + for (i = 0; i < (len); i++) \ + (c)[i] = (val); \ +} while (0) + +int run_test_unsigned() +{ + unsigned int src, nrbits; + union { + unsigned char c[TEST_LEN]; + unsigned short s[TEST_LEN/sizeof(unsigned short)]; + unsigned int i[TEST_LEN/sizeof(unsigned int)]; + unsigned long l[TEST_LEN/sizeof(unsigned long)]; + unsigned long long ll[TEST_LEN/sizeof(unsigned long long)]; + } target; + unsigned long long readval; + unsigned int s, l; + int err = 0; + + src = srcrand; + nrbits = fls(src); + + for (s = 0; s < CHAR_BIT * TEST_LEN; s++) { + for (l = nrbits; l < (CHAR_BIT * TEST_LEN) - s; l++) { + init_byte_array(target.c, TEST_LEN, 0xFF); + bt_bitfield_write(target.c, unsigned char, s, l, src); + bt_bitfield_read(target.c, unsigned char, s, l, &readval); + err = readval != src ? 1 : err; + + init_byte_array(target.c, TEST_LEN, 0xFF); + bt_bitfield_write(target.s, unsigned short, s, l, src); + bt_bitfield_read(target.c, unsigned char, s, l, &readval); + err = readval != src ? 1 : err; + + init_byte_array(target.c, TEST_LEN, 0xFF); + bt_bitfield_write(target.i, unsigned int, s, l, src); + bt_bitfield_read(target.c, unsigned char, s, l, &readval); + err = readval != src ? 1 : err; + + init_byte_array(target.c, TEST_LEN, 0xFF); + bt_bitfield_write(target.l, unsigned long, s, l, src); + bt_bitfield_read(target.c, unsigned char, s, l, &readval); + err = readval != src ? 1 : err; + + init_byte_array(target.c, TEST_LEN, 0xFF); + bt_bitfield_write(target.ll, unsigned long long, s, l, src); + bt_bitfield_read(target.c, unsigned char, s, l, &readval); + err = readval != src ? 1 : err; + + if (err) { + goto end; + } + } + } +end: + ok(err == 0, "Writing and reading back 0x%X, unsigned", src); + if (err) { + printf("# Failed with start=%i and length=%i\n", s, l); + } + return err; +} + +int run_test_signed() +{ + int src, nrbits; + union { + signed char c[TEST_LEN]; + short s[TEST_LEN/sizeof(short)]; + int i[TEST_LEN/sizeof(int)]; + long l[TEST_LEN/sizeof(long)]; + long long ll[TEST_LEN/sizeof(long long)]; + } target; + long long readval; + unsigned int s, l; + int err = 0; + + src = srcrand; + if (src & 0x80000000U) + nrbits = fls(~src) + 1; /* Find least significant bit conveying sign */ + else + nrbits = fls(src) + 1; /* Keep sign at 0 */ + + for (s = 0; s < CHAR_BIT * TEST_LEN; s++) { + for (l = nrbits; l < (CHAR_BIT * TEST_LEN) - s; l++) { + init_byte_array(target.c, TEST_LEN, 0x0); + bt_bitfield_write(target.c, signed char, s, l, src); + bt_bitfield_read(target.c, signed char, s, l, &readval); + err = readval != src ? 1 : err; + + init_byte_array(target.c, TEST_LEN, 0x0); + bt_bitfield_write(target.s, short, s, l, src); + bt_bitfield_read(target.c, signed char, s, l, &readval); + err = readval != src ? 1 : err; + + init_byte_array(target.c, TEST_LEN, 0x0); + bt_bitfield_write(target.i, int, s, l, src); + bt_bitfield_read(target.c, signed char, s, l, &readval); + err = readval != src ? 1 : err; + + init_byte_array(target.c, TEST_LEN, 0x0); + bt_bitfield_write(target.l, long, s, l, src); + bt_bitfield_read(target.c, signed char, s, l, &readval); + err = readval != src ? 1 : err; + + init_byte_array(target.c, TEST_LEN, 0x0); + bt_bitfield_write(target.ll, long long, s, l, src); + bt_bitfield_read(target.c, signed char, s, l, &readval); + err = readval != src ? 1 : err; + + if (err) { + goto end; + } + } + } +end: + ok(err == 0, "Writing and reading back 0x%X, signed", src); + if (err) { + printf("#Failed with start=%i and length=%i\n", s, l); + } + return err; +} + +void run_test(void) +{ + int i; + plan_tests(NR_TESTS * 2 + 6); + + srand(time(NULL)); + + srcrand = 0; + run_test_unsigned(); + srcrand = 0; + run_test_signed(); + + srcrand = 1; + run_test_unsigned(); + + srcrand = ~0U; + run_test_unsigned(); + + srcrand = -1; + run_test_signed(); + + srcrand = (int)0x80000000U; + run_test_signed(); + + for (i = 0; i < NR_TESTS; i++) { + srcrand = rand(); + run_test_unsigned(); + run_test_signed(); + } +} + +int main(int argc, char **argv) +{ + if (argc > 1) { + /* Run interactive tests */ + unsigned long src; + unsigned int shift, len; + union { + unsigned char c[8]; + unsigned short s[4]; + unsigned int i[2]; + unsigned long l[2]; + unsigned long long ll[1]; + } target; + unsigned long long readval; + + src = atoi(argv[1]); + if (argc > 2) + shift = atoi(argv[2]); + else + shift = 12; + if (argc > 3) + len = atoi(argv[3]); + else + len = 40; + + init_byte_array(target.c, 8, 0xFF); + bt_bitfield_write(target.c, unsigned char, shift, len, src); + printf("bytewise\n"); + print_byte_array(target.c, 8); + + init_byte_array(target.c, 8, 0xFF); + bt_bitfield_write(target.s, unsigned short, shift, len, src); + printf("shortwise\n"); + print_byte_array(target.c, 8); + + init_byte_array(target.c, 8, 0xFF); + bt_bitfield_write(target.i, unsigned int, shift, len, src); + printf("intwise\n"); + print_byte_array(target.c, 8); + + init_byte_array(target.c, 8, 0xFF); + bt_bitfield_write(target.l, unsigned long, shift, len, src); + printf("longwise\n"); + print_byte_array(target.c, 8); + + init_byte_array(target.c, 8, 0xFF); + bt_bitfield_write(target.ll, unsigned long long, shift, len, src); + printf("lluwise\n"); + print_byte_array(target.c, 8); + + bt_bitfield_read(target.c, unsigned char, shift, len, &readval); + printf("read: %llX\n", readval); + print_byte_array(target.c, 8); + + return 0; + } + + /* Run tap-formated tests */ + run_test(); + return exit_status(); +} diff --git a/tests/lib/test-seeks.c b/tests/lib/test-seeks.c index 47bb42e..61f1e2b 100644 --- a/tests/lib/test-seeks.c +++ b/tests/lib/test-seeks.c @@ -225,7 +225,6 @@ int main(int argc, char **argv) if (argc < 4) { plan_skip_all("Invalid arguments: need a trace path and the start and last timestamp"); - } /* Parse arguments (Trace, begin timestamp) */ diff --git a/tests/runall.sh b/tests/runall.sh index b2af656..68dac01 100755 --- a/tests/runall.sh +++ b/tests/runall.sh @@ -5,44 +5,20 @@ DIR=$(readlink -f ${TESTDIR}) BABELTRACE_BIN=${DIR}/../converter/babeltrace CTF_TRACES=${DIR}/ctf-traces -function print_ok () +function test_check_success () { - # Check if we are a terminal - if [ -t 1 ]; then - echo -e "\e[1;32mOK\e[0m" - else - echo -e "OK" - fi -} - -function print_fail () -{ - # Check if we are a terminal - if [ -t 1 ]; then - echo -e "\e[1;31mFAIL\e[0m" - else - echo -e "FAIL" - fi -} - -function test_check () -{ - if [ $? -ne 0 ] ; then - print_fail + if [ $? -ne 0 ]; then return 1 else - print_ok return 0 fi } function test_check_fail () { - if [ $? -ne 1 ] ; then - print_fail + if [ $? -eq 0 ]; then return 1 else - print_ok return 0 fi } @@ -53,45 +29,48 @@ function run_babeltrace () return $? } -echo -e "Running test-bitfield..." -./test-bitfield -test_check -if [ $? -ne 0 ]; then - exit 1 -fi - -#run babeltrace expects success -echo -e "Running babeltrace without argument..." -run_babeltrace -test_check -if [ $? -ne 0 ]; then - exit 1 -fi - -for a in ${CTF_TRACES}/succeed/*; do - echo -e "Running babeltrace for trace ${a}..." - run_babeltrace ${a} - test_check - if [ $? -ne 0 ]; then +function print_test_result () +{ + if [ $# -ne 3 ]; then + echo "Invalid arguments provided" exit 1 fi -done -#run babeltrace expects failure -echo -e "Running babeltrace with bogus argument..." + if [ ${2} -eq 0 ]; then + echo -n "ok" + else + echo -n "not ok" + fi + echo -e " "${1}" - "${3} +} + +successTraces=(${CTF_TRACES}/succeed/*) +failTraces=(${CTF_TRACES}/fail/*) +testCount=$((2 + ${#successTraces[@]} + ${#failTraces[@]})) + +currentTestIndex=1 +echo -e 1..${testCount} + +#run babeltrace, expects success +run_babeltrace +test_check_success +print_test_result $((currentTestIndex++)) $? "Running babeltrace without arguments" + +#run babeltrace with a bogus argument, expects failure run_babeltrace --bogusarg test_check_fail -if [ $? -ne 0 ]; then - exit 1 -fi +print_test_result $((currentTestIndex++)) $? "Running babeltrace with a bogus argument" + +for tracePath in ${successTraces[@]}; do + run_babeltrace ${tracePath} + test_check_success + print_test_result $((currentTestIndex++)) $? "Running babeltrace with trace ${tracePath}" +done -for a in ${CTF_TRACES}/fail/*; do - echo -e "Running babeltrace for trace ${a}..." - run_babeltrace ${a} +for tracePath in ${failTraces[@]}; do + run_babeltrace ${tracePath} test_check_fail - if [ $? -ne 0 ]; then - exit 1 - fi + print_test_result $((currentTestIndex++)) $? "Running babeltrace with trace ${tracePath}" done exit 0 diff --git a/tests/test-bitfield.c b/tests/test-bitfield.c deleted file mode 100644 index 3bf7568..0000000 --- a/tests/test-bitfield.c +++ /dev/null @@ -1,371 +0,0 @@ -/* - * test-bitfield.c - * - * BabelTrace - bitfield test program - * - * Copyright 2010 - Mathieu Desnoyers - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; under version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#define _GNU_SOURCE -#include -#include -#include -#include - -unsigned int glob; - -/* - * This function is only declared to show the size of a bitfield write in - * objdump. - */ -void fct(void) -{ - bt_bitfield_write(&glob, unsigned int, 12, 15, 0x12345678); -} - -/* Test array size, in bytes */ -#define TEST_LEN 128 -#define NR_TESTS 10 - -unsigned int srcrand; - -#if defined(__i386) || defined(__x86_64) - -static inline int fls(int x) -{ - int r; - asm("bsrl %1,%0\n\t" - "cmovzl %2,%0" - : "=&r" (r) : "rm" (x), "rm" (-1)); - return r + 1; -} - -#elif defined(__PPC__) - -static __inline__ int fls(unsigned int x) -{ - int lz; - - asm ("cntlzw %0,%1" : "=r" (lz) : "r" (x)); - return 32 - lz; -} - -#else - -static int fls(unsigned int x) -{ - int r = 32; - - if (!x) - return 0; - if (!(x & 0xFFFF0000U)) { - x <<= 16; - r -= 16; - } - if (!(x & 0xFF000000U)) { - x <<= 8; - r -= 8; - } - if (!(x & 0xF0000000U)) { - x <<= 4; - r -= 4; - } - if (!(x & 0xC0000000U)) { - x <<= 2; - r -= 2; - } - if (!(x & 0x80000000U)) { - x <<= 1; - r -= 1; - } - return r; -} - -#endif - -#define print_byte_array(c, len) \ -do { \ - unsigned long i; \ - \ - for (i = 0; i < (len); i++) { \ - printf("0x%X", (c)[i]); \ - if (i != (len) - 1) \ - printf(" "); \ - } \ - printf("\n"); \ -} while (0) - -#define init_byte_array(c, len, val) \ -do { \ - unsigned long i; \ - \ - for (i = 0; i < (len); i++) \ - (c)[i] = (val); \ -} while (0) - -int run_test_unsigned(void) -{ - unsigned int src, nrbits; - union { - unsigned char c[TEST_LEN]; - unsigned short s[TEST_LEN/sizeof(unsigned short)]; - unsigned int i[TEST_LEN/sizeof(unsigned int)]; - unsigned long l[TEST_LEN/sizeof(unsigned long)]; - unsigned long long ll[TEST_LEN/sizeof(unsigned long long)]; - } target; - unsigned long long readval; - unsigned int s, l; - int err = 0; - - printf("Running unsigned test with 0x%X\n", srcrand); - - src = srcrand; - nrbits = fls(src); - - for (s = 0; s < CHAR_BIT * TEST_LEN; s++) { - for (l = nrbits; l < (CHAR_BIT * TEST_LEN) - s; l++) { - init_byte_array(target.c, TEST_LEN, 0xFF); - bt_bitfield_write(target.c, unsigned char, s, l, src); - bt_bitfield_read(target.c, unsigned char, s, l, &readval); - if (readval != src) { - printf("Error (bytewise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; - } - - init_byte_array(target.c, TEST_LEN, 0xFF); - bt_bitfield_write(target.s, unsigned short, s, l, src); - bt_bitfield_read(target.c, unsigned char, s, l, &readval); - if (readval != src) { - printf("Error (shortwise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; - } - - init_byte_array(target.c, TEST_LEN, 0xFF); - bt_bitfield_write(target.i, unsigned int, s, l, src); - bt_bitfield_read(target.c, unsigned char, s, l, &readval); - if (readval != src) { - printf("Error (intwise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; - } - - init_byte_array(target.c, TEST_LEN, 0xFF); - bt_bitfield_write(target.l, unsigned long, s, l, src); - bt_bitfield_read(target.c, unsigned char, s, l, &readval); - if (readval != src) { - printf("Error (longwise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; - } - - init_byte_array(target.c, TEST_LEN, 0xFF); - bt_bitfield_write(target.ll, unsigned long long, s, l, src); - bt_bitfield_read(target.c, unsigned char, s, l, &readval); - if (readval != src) { - printf("Error (longlongwise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; - } - } - } - if (!err) - printf("Success!\n"); - else - printf("Failed!\n"); - return err; -} - -int run_test_signed(void) -{ - int src, nrbits; - union { - signed char c[TEST_LEN]; - short s[TEST_LEN/sizeof(short)]; - int i[TEST_LEN/sizeof(int)]; - long l[TEST_LEN/sizeof(long)]; - long long ll[TEST_LEN/sizeof(long long)]; - } target; - long long readval; - unsigned int s, l; - int err = 0; - - printf("Running signed test with 0x%X\n", srcrand); - - src = srcrand; - if (src & 0x80000000U) - nrbits = fls(~src) + 1; /* Find least significant bit conveying sign */ - else - nrbits = fls(src) + 1; /* Keep sign at 0 */ - - for (s = 0; s < 8 * TEST_LEN; s++) { - for (l = nrbits; l < (8 * TEST_LEN) - s; l++) { - init_byte_array(target.c, TEST_LEN, 0x0); - bt_bitfield_write(target.c, signed char, s, l, src); - bt_bitfield_read(target.c, signed char, s, l, &readval); - if (readval != src) { - printf("Error (bytewise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; - } - - init_byte_array(target.c, TEST_LEN, 0x0); - bt_bitfield_write(target.s, short, s, l, src); - bt_bitfield_read(target.c, signed char, s, l, &readval); - if (readval != src) { - printf("Error (shortwise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; - } - - init_byte_array(target.c, TEST_LEN, 0x0); - bt_bitfield_write(target.i, int, s, l, src); - bt_bitfield_read(target.c, signed char, s, l, &readval); - if (readval != src) { - printf("Error (intwise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; - } - - init_byte_array(target.c, TEST_LEN, 0x0); - bt_bitfield_write(target.l, long, s, l, src); - bt_bitfield_read(target.c, signed char, s, l, &readval); - if (readval != src) { - printf("Error (longwise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; - } - - init_byte_array(target.c, TEST_LEN, 0x0); - bt_bitfield_write(target.ll, long long, s, l, src); - bt_bitfield_read(target.c, signed char, s, l, &readval); - if (readval != src) { - printf("Error (longlongwise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; - } - } - } - if (!err) - printf("Success!\n"); - else - printf("Failed!\n"); - return err; -} - -int run_test(void) -{ - int err = 0; - int i; - - srand(time(NULL)); - - srcrand = 0; - err |= run_test_unsigned(); - srcrand = 0; - err |= run_test_signed(); - srcrand = 1; - err |= run_test_unsigned(); - srcrand = ~0U; - err |= run_test_unsigned(); - srcrand = -1; - err |= run_test_signed(); - srcrand = (int)0x80000000U; - err |= run_test_signed(); - - for (i = 0; i < NR_TESTS; i++) { - srcrand = rand(); - err |= run_test_unsigned(); - err |= run_test_signed(); - } - return err; -} - -int main(int argc, char **argv) -{ - unsigned long src; - unsigned int shift, len; - int ret; - union { - unsigned char c[8]; - unsigned short s[4]; - unsigned int i[2]; - unsigned long l[2]; - unsigned long long ll[1]; - } target; - unsigned long long readval; - - if (argc > 1) - src = atoi(argv[1]); - else - src = 0x12345678; - if (argc > 2) - shift = atoi(argv[2]); - else - shift = 12; - if (argc > 3) - len = atoi(argv[3]); - else - len = 40; - - target.i[0] = 0xFFFFFFFF; - target.i[1] = 0xFFFFFFFF; - bt_bitfield_write(target.c, unsigned char, shift, len, src); - printf("bytewise\n"); - print_byte_array(target.c, 8); - - target.i[0] = 0xFFFFFFFF; - target.i[1] = 0xFFFFFFFF; - bt_bitfield_write(target.s, unsigned short, shift, len, src); - printf("shortwise\n"); - print_byte_array(target.c, 8); - - target.i[0] = 0xFFFFFFFF; - target.i[1] = 0xFFFFFFFF; - bt_bitfield_write(target.i, unsigned int, shift, len, src); - printf("intwise\n"); - print_byte_array(target.c, 8); - - target.i[0] = 0xFFFFFFFF; - target.i[1] = 0xFFFFFFFF; - bt_bitfield_write(target.l, unsigned long, shift, len, src); - printf("longwise\n"); - print_byte_array(target.c, 8); - - target.i[0] = 0xFFFFFFFF; - target.i[1] = 0xFFFFFFFF; - bt_bitfield_write(target.ll, unsigned long long, shift, len, src); - printf("lluwise\n"); - print_byte_array(target.c, 8); - - bt_bitfield_read(target.c, unsigned char, shift, len, &readval); - printf("read: %llX\n", readval); - - ret = run_test(); - - return ret; -} -- 1.8.1.1 From mathieu.desnoyers at efficios.com Thu Feb 7 12:45:26 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 7 Feb 2013 12:45:26 -0500 Subject: [lttng-dev] [PATCH babeltrace 1/1] Converted the unit tests to the TAP format and moved the bitfield test In-Reply-To: <1360257924-7460-1-git-send-email-jeremie.galarneau@efficios.com> References: <1360257924-7460-1-git-send-email-jeremie.galarneau@efficios.com> Message-ID: <20130207174526.GA6632@Krystal> some somments: please use the present for your subject and patch description: converted -> convert moved -> move * J?r?mie Galarneau (jeremie.galarneau at efficios.com) wrote: > > Signed-off-by: J?r?mie Galarneau > --- > tests/Makefile.am | 4 - > tests/lib/Makefile.am | 7 +- > tests/lib/runall.sh | 5 +- > tests/lib/test-bitfield.c | 331 +++++++++++++++++++++++++++++++++++++++++ > tests/lib/test-seeks.c | 1 - > tests/runall.sh | 97 +++++------- > tests/test-bitfield.c | 371 ---------------------------------------------- > 7 files changed, 379 insertions(+), 437 deletions(-) > create mode 100644 tests/lib/test-bitfield.c > delete mode 100644 tests/test-bitfield.c > > diff --git a/tests/Makefile.am b/tests/Makefile.am > index 47891e9..816fa66 100644 > --- a/tests/Makefile.am > +++ b/tests/Makefile.am > @@ -2,10 +2,6 @@ AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include > > SUBDIRS = lib > > -noinst_PROGRAMS = test-bitfield > - > -test_bitfield_SOURCES = test-bitfield.c > - > EXTRA_DIST = runall.sh ctf-traces/** > > check-am: > diff --git a/tests/lib/Makefile.am b/tests/lib/Makefile.am > index e9e264b..1e3d80f 100644 > --- a/tests/lib/Makefile.am > +++ b/tests/lib/Makefile.am > @@ -8,9 +8,14 @@ test_seeks_LDADD = libtestcommon.a \ > $(top_builddir)/lib/libbabeltrace.la \ > $(top_builddir)/formats/ctf/libbabeltrace-ctf.la > > -noinst_PROGRAMS = test-seeks > +test_bitfield_LDADD = libtestcommon.a \ > + $(top_builddir)/lib/libbabeltrace.la \ > + $(top_builddir)/formats/ctf/libbabeltrace-ctf.la why LDADD those libs for test_bitfield ? > + > +noinst_PROGRAMS = test-seeks test-bitfield > > test_seeks_SOURCES = test-seeks.c > +test_bitfield_SOURCES = test-bitfield.c > > EXTRA_DIST = README.tap runall.sh > > diff --git a/tests/lib/runall.sh b/tests/lib/runall.sh > index 34503bb..b5522ad 100755 > --- a/tests/lib/runall.sh > +++ b/tests/lib/runall.sh > @@ -3,4 +3,7 @@ > # With a trace than contains empty packets > ./test-seeks ../ctf-traces/succeed/wk-heartbeat-u/ 1351532897586558519 1351532897591331194 > # With a bigger trace > -./test-seeks ../ctf-traces/succeed/lttng-modules-2.0-pre5/ 61334174524234 61336381998396 > \ No newline at end of file > +./test-seeks ../ctf-traces/succeed/lttng-modules-2.0-pre5/ 61334174524234 61336381998396 > + > +# run bitfield tests > +./test-bitfield > diff --git a/tests/lib/test-bitfield.c b/tests/lib/test-bitfield.c > new file mode 100644 > index 0000000..58f0b5e > --- /dev/null > +++ b/tests/lib/test-bitfield.c > @@ -0,0 +1,331 @@ > +/* > + * test-bitfield.c > + * > + * BabelTrace - bitfield test program > + * > + * Copyright 2010 - Mathieu Desnoyers > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License as published by > + * the Free Software Foundation; under version 2 of the License. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License along > + * with this program; if not, write to the Free Software Foundation, Inc., > + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > + */ > + > +#define _GNU_SOURCE > +#include > +#include > +#include > +#include > +#include > + > +#include "tap.h" > + > +unsigned int glob; > + > +/* > + * This function is only declared to show the size of a bitfield write in > + * objdump. > + */ > +void fct(void) > +{ > + bt_bitfield_write(&glob, unsigned int, 12, 15, 0x12345678); > +} > + > +/* Test array size, in bytes */ > +#define TEST_LEN 128 > +#define NR_TESTS 10 > +#define TYPES_CNT 5 > + > +unsigned int srcrand; > + > +#if defined(__i386) || defined(__x86_64) > + > +static inline int fls(int x) > +{ > + int r; > + asm("bsrl %1,%0\n\t" > + "cmovzl %2,%0" > + : "=&r" (r) : "rm" (x), "rm" (-1)); > + return r + 1; > +} > + > +#elif defined(__PPC__) > + > +static __inline__ int fls(unsigned int x) > +{ > + int lz; > + > + asm ("cntlzw %0,%1" : "=r" (lz) : "r" (x)); > + return 32 - lz; > +} > + > +#else > + > +static int fls(unsigned int x) > +{ > + int r = 32; > + > + if (!x) > + return 0; > + if (!(x & 0xFFFF0000U)) { > + x <<= 16; > + r -= 16; > + } > + if (!(x & 0xFF000000U)) { > + x <<= 8; > + r -= 8; > + } > + if (!(x & 0xF0000000U)) { > + x <<= 4; > + r -= 4; > + } > + if (!(x & 0xC0000000U)) { > + x <<= 2; > + r -= 2; > + } > + if (!(x & 0x80000000U)) { > + x <<= 1; > + r -= 1; > + } > + return r; > +} > + > +#endif > + > +#define print_byte_array(c, len) \ > +do { \ > + unsigned long i; \ > + \ > + for (i = 0; i < (len); i++) { \ > + printf("0x%X", (c)[i]); \ > + if (i != (len) - 1) \ > + printf(" "); \ > + } \ > + printf("\n"); \ > +} while (0) > + > +#define init_byte_array(c, len, val) \ > +do { \ > + unsigned long i; \ > + \ > + for (i = 0; i < (len); i++) \ > + (c)[i] = (val); \ > +} while (0) > + > +int run_test_unsigned() is it me or the "(void") went away ? Even though C++ accepts this, it is not good in C, as this is the same as "int run_test_unsigned(...)". Please move the bitfield test into tests/lib/ in a separate patch, without changing any code within the file. Thanks, Mathieu > +{ > + unsigned int src, nrbits; > + union { > + unsigned char c[TEST_LEN]; > + unsigned short s[TEST_LEN/sizeof(unsigned short)]; > + unsigned int i[TEST_LEN/sizeof(unsigned int)]; > + unsigned long l[TEST_LEN/sizeof(unsigned long)]; > + unsigned long long ll[TEST_LEN/sizeof(unsigned long long)]; > + } target; > + unsigned long long readval; > + unsigned int s, l; > + int err = 0; > + > + src = srcrand; > + nrbits = fls(src); > + > + for (s = 0; s < CHAR_BIT * TEST_LEN; s++) { > + for (l = nrbits; l < (CHAR_BIT * TEST_LEN) - s; l++) { > + init_byte_array(target.c, TEST_LEN, 0xFF); > + bt_bitfield_write(target.c, unsigned char, s, l, src); > + bt_bitfield_read(target.c, unsigned char, s, l, &readval); > + err = readval != src ? 1 : err; > + > + init_byte_array(target.c, TEST_LEN, 0xFF); > + bt_bitfield_write(target.s, unsigned short, s, l, src); > + bt_bitfield_read(target.c, unsigned char, s, l, &readval); > + err = readval != src ? 1 : err; > + > + init_byte_array(target.c, TEST_LEN, 0xFF); > + bt_bitfield_write(target.i, unsigned int, s, l, src); > + bt_bitfield_read(target.c, unsigned char, s, l, &readval); > + err = readval != src ? 1 : err; > + > + init_byte_array(target.c, TEST_LEN, 0xFF); > + bt_bitfield_write(target.l, unsigned long, s, l, src); > + bt_bitfield_read(target.c, unsigned char, s, l, &readval); > + err = readval != src ? 1 : err; > + > + init_byte_array(target.c, TEST_LEN, 0xFF); > + bt_bitfield_write(target.ll, unsigned long long, s, l, src); > + bt_bitfield_read(target.c, unsigned char, s, l, &readval); > + err = readval != src ? 1 : err; > + > + if (err) { > + goto end; > + } > + } > + } > +end: > + ok(err == 0, "Writing and reading back 0x%X, unsigned", src); > + if (err) { > + printf("# Failed with start=%i and length=%i\n", s, l); > + } > + return err; > +} > + > +int run_test_signed() > +{ > + int src, nrbits; > + union { > + signed char c[TEST_LEN]; > + short s[TEST_LEN/sizeof(short)]; > + int i[TEST_LEN/sizeof(int)]; > + long l[TEST_LEN/sizeof(long)]; > + long long ll[TEST_LEN/sizeof(long long)]; > + } target; > + long long readval; > + unsigned int s, l; > + int err = 0; > + > + src = srcrand; > + if (src & 0x80000000U) > + nrbits = fls(~src) + 1; /* Find least significant bit conveying sign */ > + else > + nrbits = fls(src) + 1; /* Keep sign at 0 */ > + > + for (s = 0; s < CHAR_BIT * TEST_LEN; s++) { > + for (l = nrbits; l < (CHAR_BIT * TEST_LEN) - s; l++) { > + init_byte_array(target.c, TEST_LEN, 0x0); > + bt_bitfield_write(target.c, signed char, s, l, src); > + bt_bitfield_read(target.c, signed char, s, l, &readval); > + err = readval != src ? 1 : err; > + > + init_byte_array(target.c, TEST_LEN, 0x0); > + bt_bitfield_write(target.s, short, s, l, src); > + bt_bitfield_read(target.c, signed char, s, l, &readval); > + err = readval != src ? 1 : err; > + > + init_byte_array(target.c, TEST_LEN, 0x0); > + bt_bitfield_write(target.i, int, s, l, src); > + bt_bitfield_read(target.c, signed char, s, l, &readval); > + err = readval != src ? 1 : err; > + > + init_byte_array(target.c, TEST_LEN, 0x0); > + bt_bitfield_write(target.l, long, s, l, src); > + bt_bitfield_read(target.c, signed char, s, l, &readval); > + err = readval != src ? 1 : err; > + > + init_byte_array(target.c, TEST_LEN, 0x0); > + bt_bitfield_write(target.ll, long long, s, l, src); > + bt_bitfield_read(target.c, signed char, s, l, &readval); > + err = readval != src ? 1 : err; > + > + if (err) { > + goto end; > + } > + } > + } > +end: > + ok(err == 0, "Writing and reading back 0x%X, signed", src); > + if (err) { > + printf("#Failed with start=%i and length=%i\n", s, l); > + } > + return err; > +} > + > +void run_test(void) > +{ > + int i; > + plan_tests(NR_TESTS * 2 + 6); > + > + srand(time(NULL)); > + > + srcrand = 0; > + run_test_unsigned(); > + srcrand = 0; > + run_test_signed(); > + > + srcrand = 1; > + run_test_unsigned(); > + > + srcrand = ~0U; > + run_test_unsigned(); > + > + srcrand = -1; > + run_test_signed(); > + > + srcrand = (int)0x80000000U; > + run_test_signed(); > + > + for (i = 0; i < NR_TESTS; i++) { > + srcrand = rand(); > + run_test_unsigned(); > + run_test_signed(); > + } > +} > + > +int main(int argc, char **argv) > +{ > + if (argc > 1) { > + /* Run interactive tests */ > + unsigned long src; > + unsigned int shift, len; > + union { > + unsigned char c[8]; > + unsigned short s[4]; > + unsigned int i[2]; > + unsigned long l[2]; > + unsigned long long ll[1]; > + } target; > + unsigned long long readval; > + > + src = atoi(argv[1]); > + if (argc > 2) > + shift = atoi(argv[2]); > + else > + shift = 12; > + if (argc > 3) > + len = atoi(argv[3]); > + else > + len = 40; > + > + init_byte_array(target.c, 8, 0xFF); > + bt_bitfield_write(target.c, unsigned char, shift, len, src); > + printf("bytewise\n"); > + print_byte_array(target.c, 8); > + > + init_byte_array(target.c, 8, 0xFF); > + bt_bitfield_write(target.s, unsigned short, shift, len, src); > + printf("shortwise\n"); > + print_byte_array(target.c, 8); > + > + init_byte_array(target.c, 8, 0xFF); > + bt_bitfield_write(target.i, unsigned int, shift, len, src); > + printf("intwise\n"); > + print_byte_array(target.c, 8); > + > + init_byte_array(target.c, 8, 0xFF); > + bt_bitfield_write(target.l, unsigned long, shift, len, src); > + printf("longwise\n"); > + print_byte_array(target.c, 8); > + > + init_byte_array(target.c, 8, 0xFF); > + bt_bitfield_write(target.ll, unsigned long long, shift, len, src); > + printf("lluwise\n"); > + print_byte_array(target.c, 8); > + > + bt_bitfield_read(target.c, unsigned char, shift, len, &readval); > + printf("read: %llX\n", readval); > + print_byte_array(target.c, 8); > + > + return 0; > + } > + > + /* Run tap-formated tests */ > + run_test(); > + return exit_status(); > +} > diff --git a/tests/lib/test-seeks.c b/tests/lib/test-seeks.c > index 47bb42e..61f1e2b 100644 > --- a/tests/lib/test-seeks.c > +++ b/tests/lib/test-seeks.c > @@ -225,7 +225,6 @@ int main(int argc, char **argv) > > if (argc < 4) { > plan_skip_all("Invalid arguments: need a trace path and the start and last timestamp"); > - > } > > /* Parse arguments (Trace, begin timestamp) */ > diff --git a/tests/runall.sh b/tests/runall.sh > index b2af656..68dac01 100755 > --- a/tests/runall.sh > +++ b/tests/runall.sh > @@ -5,44 +5,20 @@ DIR=$(readlink -f ${TESTDIR}) > BABELTRACE_BIN=${DIR}/../converter/babeltrace > CTF_TRACES=${DIR}/ctf-traces > > -function print_ok () > +function test_check_success () > { > - # Check if we are a terminal > - if [ -t 1 ]; then > - echo -e "\e[1;32mOK\e[0m" > - else > - echo -e "OK" > - fi > -} > - > -function print_fail () > -{ > - # Check if we are a terminal > - if [ -t 1 ]; then > - echo -e "\e[1;31mFAIL\e[0m" > - else > - echo -e "FAIL" > - fi > -} > - > -function test_check () > -{ > - if [ $? -ne 0 ] ; then > - print_fail > + if [ $? -ne 0 ]; then > return 1 > else > - print_ok > return 0 > fi > } > > function test_check_fail () > { > - if [ $? -ne 1 ] ; then > - print_fail > + if [ $? -eq 0 ]; then > return 1 > else > - print_ok > return 0 > fi > } > @@ -53,45 +29,48 @@ function run_babeltrace () > return $? > } > > -echo -e "Running test-bitfield..." > -./test-bitfield > -test_check > -if [ $? -ne 0 ]; then > - exit 1 > -fi > - > -#run babeltrace expects success > -echo -e "Running babeltrace without argument..." > -run_babeltrace > -test_check > -if [ $? -ne 0 ]; then > - exit 1 > -fi > - > -for a in ${CTF_TRACES}/succeed/*; do > - echo -e "Running babeltrace for trace ${a}..." > - run_babeltrace ${a} > - test_check > - if [ $? -ne 0 ]; then > +function print_test_result () > +{ > + if [ $# -ne 3 ]; then > + echo "Invalid arguments provided" > exit 1 > fi > -done > > -#run babeltrace expects failure > -echo -e "Running babeltrace with bogus argument..." > + if [ ${2} -eq 0 ]; then > + echo -n "ok" > + else > + echo -n "not ok" > + fi > + echo -e " "${1}" - "${3} > +} > + > +successTraces=(${CTF_TRACES}/succeed/*) > +failTraces=(${CTF_TRACES}/fail/*) > +testCount=$((2 + ${#successTraces[@]} + ${#failTraces[@]})) > + > +currentTestIndex=1 > +echo -e 1..${testCount} > + > +#run babeltrace, expects success > +run_babeltrace > +test_check_success > +print_test_result $((currentTestIndex++)) $? "Running babeltrace without arguments" > + > +#run babeltrace with a bogus argument, expects failure > run_babeltrace --bogusarg > test_check_fail > -if [ $? -ne 0 ]; then > - exit 1 > -fi > +print_test_result $((currentTestIndex++)) $? "Running babeltrace with a bogus argument" > + > +for tracePath in ${successTraces[@]}; do > + run_babeltrace ${tracePath} > + test_check_success > + print_test_result $((currentTestIndex++)) $? "Running babeltrace with trace ${tracePath}" > +done > > -for a in ${CTF_TRACES}/fail/*; do > - echo -e "Running babeltrace for trace ${a}..." > - run_babeltrace ${a} > +for tracePath in ${failTraces[@]}; do > + run_babeltrace ${tracePath} > test_check_fail > - if [ $? -ne 0 ]; then > - exit 1 > - fi > + print_test_result $((currentTestIndex++)) $? "Running babeltrace with trace ${tracePath}" > done > > exit 0 > diff --git a/tests/test-bitfield.c b/tests/test-bitfield.c > deleted file mode 100644 > index 3bf7568..0000000 > --- a/tests/test-bitfield.c > +++ /dev/null > @@ -1,371 +0,0 @@ > -/* > - * test-bitfield.c > - * > - * BabelTrace - bitfield test program > - * > - * Copyright 2010 - Mathieu Desnoyers > - * > - * This program is free software; you can redistribute it and/or modify > - * it under the terms of the GNU General Public License as published by > - * the Free Software Foundation; under version 2 of the License. > - * > - * This program is distributed in the hope that it will be useful, > - * but WITHOUT ANY WARRANTY; without even the implied warranty of > - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > - * GNU General Public License for more details. > - * > - * You should have received a copy of the GNU General Public License along > - * with this program; if not, write to the Free Software Foundation, Inc., > - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > - */ > - > -#define _GNU_SOURCE > -#include > -#include > -#include > -#include > - > -unsigned int glob; > - > -/* > - * This function is only declared to show the size of a bitfield write in > - * objdump. > - */ > -void fct(void) > -{ > - bt_bitfield_write(&glob, unsigned int, 12, 15, 0x12345678); > -} > - > -/* Test array size, in bytes */ > -#define TEST_LEN 128 > -#define NR_TESTS 10 > - > -unsigned int srcrand; > - > -#if defined(__i386) || defined(__x86_64) > - > -static inline int fls(int x) > -{ > - int r; > - asm("bsrl %1,%0\n\t" > - "cmovzl %2,%0" > - : "=&r" (r) : "rm" (x), "rm" (-1)); > - return r + 1; > -} > - > -#elif defined(__PPC__) > - > -static __inline__ int fls(unsigned int x) > -{ > - int lz; > - > - asm ("cntlzw %0,%1" : "=r" (lz) : "r" (x)); > - return 32 - lz; > -} > - > -#else > - > -static int fls(unsigned int x) > -{ > - int r = 32; > - > - if (!x) > - return 0; > - if (!(x & 0xFFFF0000U)) { > - x <<= 16; > - r -= 16; > - } > - if (!(x & 0xFF000000U)) { > - x <<= 8; > - r -= 8; > - } > - if (!(x & 0xF0000000U)) { > - x <<= 4; > - r -= 4; > - } > - if (!(x & 0xC0000000U)) { > - x <<= 2; > - r -= 2; > - } > - if (!(x & 0x80000000U)) { > - x <<= 1; > - r -= 1; > - } > - return r; > -} > - > -#endif > - > -#define print_byte_array(c, len) \ > -do { \ > - unsigned long i; \ > - \ > - for (i = 0; i < (len); i++) { \ > - printf("0x%X", (c)[i]); \ > - if (i != (len) - 1) \ > - printf(" "); \ > - } \ > - printf("\n"); \ > -} while (0) > - > -#define init_byte_array(c, len, val) \ > -do { \ > - unsigned long i; \ > - \ > - for (i = 0; i < (len); i++) \ > - (c)[i] = (val); \ > -} while (0) > - > -int run_test_unsigned(void) > -{ > - unsigned int src, nrbits; > - union { > - unsigned char c[TEST_LEN]; > - unsigned short s[TEST_LEN/sizeof(unsigned short)]; > - unsigned int i[TEST_LEN/sizeof(unsigned int)]; > - unsigned long l[TEST_LEN/sizeof(unsigned long)]; > - unsigned long long ll[TEST_LEN/sizeof(unsigned long long)]; > - } target; > - unsigned long long readval; > - unsigned int s, l; > - int err = 0; > - > - printf("Running unsigned test with 0x%X\n", srcrand); > - > - src = srcrand; > - nrbits = fls(src); > - > - for (s = 0; s < CHAR_BIT * TEST_LEN; s++) { > - for (l = nrbits; l < (CHAR_BIT * TEST_LEN) - s; l++) { > - init_byte_array(target.c, TEST_LEN, 0xFF); > - bt_bitfield_write(target.c, unsigned char, s, l, src); > - bt_bitfield_read(target.c, unsigned char, s, l, &readval); > - if (readval != src) { > - printf("Error (bytewise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > - } > - > - init_byte_array(target.c, TEST_LEN, 0xFF); > - bt_bitfield_write(target.s, unsigned short, s, l, src); > - bt_bitfield_read(target.c, unsigned char, s, l, &readval); > - if (readval != src) { > - printf("Error (shortwise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > - } > - > - init_byte_array(target.c, TEST_LEN, 0xFF); > - bt_bitfield_write(target.i, unsigned int, s, l, src); > - bt_bitfield_read(target.c, unsigned char, s, l, &readval); > - if (readval != src) { > - printf("Error (intwise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > - } > - > - init_byte_array(target.c, TEST_LEN, 0xFF); > - bt_bitfield_write(target.l, unsigned long, s, l, src); > - bt_bitfield_read(target.c, unsigned char, s, l, &readval); > - if (readval != src) { > - printf("Error (longwise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > - } > - > - init_byte_array(target.c, TEST_LEN, 0xFF); > - bt_bitfield_write(target.ll, unsigned long long, s, l, src); > - bt_bitfield_read(target.c, unsigned char, s, l, &readval); > - if (readval != src) { > - printf("Error (longlongwise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > - } > - } > - } > - if (!err) > - printf("Success!\n"); > - else > - printf("Failed!\n"); > - return err; > -} > - > -int run_test_signed(void) > -{ > - int src, nrbits; > - union { > - signed char c[TEST_LEN]; > - short s[TEST_LEN/sizeof(short)]; > - int i[TEST_LEN/sizeof(int)]; > - long l[TEST_LEN/sizeof(long)]; > - long long ll[TEST_LEN/sizeof(long long)]; > - } target; > - long long readval; > - unsigned int s, l; > - int err = 0; > - > - printf("Running signed test with 0x%X\n", srcrand); > - > - src = srcrand; > - if (src & 0x80000000U) > - nrbits = fls(~src) + 1; /* Find least significant bit conveying sign */ > - else > - nrbits = fls(src) + 1; /* Keep sign at 0 */ > - > - for (s = 0; s < 8 * TEST_LEN; s++) { > - for (l = nrbits; l < (8 * TEST_LEN) - s; l++) { > - init_byte_array(target.c, TEST_LEN, 0x0); > - bt_bitfield_write(target.c, signed char, s, l, src); > - bt_bitfield_read(target.c, signed char, s, l, &readval); > - if (readval != src) { > - printf("Error (bytewise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > - } > - > - init_byte_array(target.c, TEST_LEN, 0x0); > - bt_bitfield_write(target.s, short, s, l, src); > - bt_bitfield_read(target.c, signed char, s, l, &readval); > - if (readval != src) { > - printf("Error (shortwise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > - } > - > - init_byte_array(target.c, TEST_LEN, 0x0); > - bt_bitfield_write(target.i, int, s, l, src); > - bt_bitfield_read(target.c, signed char, s, l, &readval); > - if (readval != src) { > - printf("Error (intwise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > - } > - > - init_byte_array(target.c, TEST_LEN, 0x0); > - bt_bitfield_write(target.l, long, s, l, src); > - bt_bitfield_read(target.c, signed char, s, l, &readval); > - if (readval != src) { > - printf("Error (longwise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > - } > - > - init_byte_array(target.c, TEST_LEN, 0x0); > - bt_bitfield_write(target.ll, long long, s, l, src); > - bt_bitfield_read(target.c, signed char, s, l, &readval); > - if (readval != src) { > - printf("Error (longlongwise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > - } > - } > - } > - if (!err) > - printf("Success!\n"); > - else > - printf("Failed!\n"); > - return err; > -} > - > -int run_test(void) > -{ > - int err = 0; > - int i; > - > - srand(time(NULL)); > - > - srcrand = 0; > - err |= run_test_unsigned(); > - srcrand = 0; > - err |= run_test_signed(); > - srcrand = 1; > - err |= run_test_unsigned(); > - srcrand = ~0U; > - err |= run_test_unsigned(); > - srcrand = -1; > - err |= run_test_signed(); > - srcrand = (int)0x80000000U; > - err |= run_test_signed(); > - > - for (i = 0; i < NR_TESTS; i++) { > - srcrand = rand(); > - err |= run_test_unsigned(); > - err |= run_test_signed(); > - } > - return err; > -} > - > -int main(int argc, char **argv) > -{ > - unsigned long src; > - unsigned int shift, len; > - int ret; > - union { > - unsigned char c[8]; > - unsigned short s[4]; > - unsigned int i[2]; > - unsigned long l[2]; > - unsigned long long ll[1]; > - } target; > - unsigned long long readval; > - > - if (argc > 1) > - src = atoi(argv[1]); > - else > - src = 0x12345678; > - if (argc > 2) > - shift = atoi(argv[2]); > - else > - shift = 12; > - if (argc > 3) > - len = atoi(argv[3]); > - else > - len = 40; > - > - target.i[0] = 0xFFFFFFFF; > - target.i[1] = 0xFFFFFFFF; > - bt_bitfield_write(target.c, unsigned char, shift, len, src); > - printf("bytewise\n"); > - print_byte_array(target.c, 8); > - > - target.i[0] = 0xFFFFFFFF; > - target.i[1] = 0xFFFFFFFF; > - bt_bitfield_write(target.s, unsigned short, shift, len, src); > - printf("shortwise\n"); > - print_byte_array(target.c, 8); > - > - target.i[0] = 0xFFFFFFFF; > - target.i[1] = 0xFFFFFFFF; > - bt_bitfield_write(target.i, unsigned int, shift, len, src); > - printf("intwise\n"); > - print_byte_array(target.c, 8); > - > - target.i[0] = 0xFFFFFFFF; > - target.i[1] = 0xFFFFFFFF; > - bt_bitfield_write(target.l, unsigned long, shift, len, src); > - printf("longwise\n"); > - print_byte_array(target.c, 8); > - > - target.i[0] = 0xFFFFFFFF; > - target.i[1] = 0xFFFFFFFF; > - bt_bitfield_write(target.ll, unsigned long long, shift, len, src); > - printf("lluwise\n"); > - print_byte_array(target.c, 8); > - > - bt_bitfield_read(target.c, unsigned char, shift, len, &readval); > - printf("read: %llX\n", readval); > - > - ret = run_test(); > - > - return ret; > -} > -- > 1.8.1.1 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mohrez.rejali at gmail.com Thu Feb 7 12:45:23 2013 From: mohrez.rejali at gmail.com (mohammad reza rejali) Date: Thu, 7 Feb 2013 12:45:23 -0500 Subject: [lttng-dev] help on using command lttng enable-event just one trace point -u Message-ID: Dear Sir/Madam I am new in this area, I downloaded the examples and run the sample file but there is a problem. I used this command lttng enable-event sample_component -u But when i use this and lltng start and then stop when I use this command lttng view, Nothing show me,the only thing it shows is the directory that created for my session. On the other hand, when I use lttng enable event -a -u and run my code,when i use lttng view i could see the trace. I really appreciate your help and thank you in advance. Best Regards, Mohammad -------------- next part -------------- An HTML attachment was scrubbed... URL: From dgoulet at efficios.com Thu Feb 7 12:51:07 2013 From: dgoulet at efficios.com (David Goulet) Date: Thu, 07 Feb 2013 12:51:07 -0500 Subject: [lttng-dev] help on using command lttng enable-event just one trace point -u In-Reply-To: References: Message-ID: <5113E98B.9040101@efficios.com> Hi, You are probably missing a part of the event name. Once your application is started, you can use "lttng list -u" to list the available events for UST tracing. It should look something like that (this is taken from the hello example in UST code tree). ust_tests_hello:tptest (loglevel: TRACE_DEBUG_LINE (13)) (type: tracepoint) $ lttng enable-event ust_tests_hello:tptest -u When creating a tracepoint event in your application, you have this: TRACEPOINT_EVENT(ust_tests_hello, tptest, ...) You have to use both part with ":" between which are the component name and name of the tracepoint. See lttng-ust(3) for an explanation. Thanks! David mohammad reza rejali: > Dear Sir/Madam > > I am new in this area, I downloaded the examples and run the sample file > but there is a problem. > I used this command lttng enable-event sample_component -u > But when i use this and lltng start and then stop when I use this > command lttng view, Nothing show me,the only thing it shows is the > directory that created for my session. > On the other hand, when I use lttng enable event -a -u and run my > code,when i use lttng view i could see the trace. > I really appreciate your help and thank you in advance. > > Best Regards, > Mohammad > > > This body part will be downloaded on demand. From jeremie.galarneau at efficios.com Thu Feb 7 16:40:52 2013 From: jeremie.galarneau at efficios.com (=?UTF-8?q?J=C3=A9r=C3=A9mie=20Galarneau?=) Date: Thu, 7 Feb 2013 16:40:52 -0500 Subject: [lttng-dev] [PATCH babeltrace 1/2] Move the bitfield test to tests/lib/ In-Reply-To: <20130207174526.GA6632@Krystal> References: <20130207174526.GA6632@Krystal> Message-ID: <1360273253-12401-1-git-send-email-jeremie.galarneau@efficios.com> Signed-off-by: J?r?mie Galarneau --- .gitignore | 2 +- tests/Makefile.am | 4 - tests/lib/Makefile.am | 3 +- tests/lib/runall.sh | 5 +- tests/lib/test-bitfield.c | 371 ++++++++++++++++++++++++++++++++++++++++++++++ tests/runall.sh | 7 - tests/test-bitfield.c | 371 ---------------------------------------------- 7 files changed, 378 insertions(+), 385 deletions(-) create mode 100644 tests/lib/test-bitfield.c delete mode 100644 tests/test-bitfield.c diff --git a/.gitignore b/.gitignore index 03443df..752308e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -/tests/test-bitfield +/tests/lib/test-bitfield /tests/lib/test-seeks *.o *.a diff --git a/tests/Makefile.am b/tests/Makefile.am index 47891e9..816fa66 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -2,10 +2,6 @@ AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include SUBDIRS = lib -noinst_PROGRAMS = test-bitfield - -test_bitfield_SOURCES = test-bitfield.c - EXTRA_DIST = runall.sh ctf-traces/** check-am: diff --git a/tests/lib/Makefile.am b/tests/lib/Makefile.am index e9e264b..0613beb 100644 --- a/tests/lib/Makefile.am +++ b/tests/lib/Makefile.am @@ -8,9 +8,10 @@ test_seeks_LDADD = libtestcommon.a \ $(top_builddir)/lib/libbabeltrace.la \ $(top_builddir)/formats/ctf/libbabeltrace-ctf.la -noinst_PROGRAMS = test-seeks +noinst_PROGRAMS = test-seeks test-bitfield test_seeks_SOURCES = test-seeks.c +test_bitfield_SOURCES = test-bitfield.c EXTRA_DIST = README.tap runall.sh diff --git a/tests/lib/runall.sh b/tests/lib/runall.sh index 34503bb..b5522ad 100755 --- a/tests/lib/runall.sh +++ b/tests/lib/runall.sh @@ -3,4 +3,7 @@ # With a trace than contains empty packets ./test-seeks ../ctf-traces/succeed/wk-heartbeat-u/ 1351532897586558519 1351532897591331194 # With a bigger trace -./test-seeks ../ctf-traces/succeed/lttng-modules-2.0-pre5/ 61334174524234 61336381998396 \ No newline at end of file +./test-seeks ../ctf-traces/succeed/lttng-modules-2.0-pre5/ 61334174524234 61336381998396 + +# run bitfield tests +./test-bitfield diff --git a/tests/lib/test-bitfield.c b/tests/lib/test-bitfield.c new file mode 100644 index 0000000..3bf7568 --- /dev/null +++ b/tests/lib/test-bitfield.c @@ -0,0 +1,371 @@ +/* + * test-bitfield.c + * + * BabelTrace - bitfield test program + * + * Copyright 2010 - Mathieu Desnoyers + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; under version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#define _GNU_SOURCE +#include +#include +#include +#include + +unsigned int glob; + +/* + * This function is only declared to show the size of a bitfield write in + * objdump. + */ +void fct(void) +{ + bt_bitfield_write(&glob, unsigned int, 12, 15, 0x12345678); +} + +/* Test array size, in bytes */ +#define TEST_LEN 128 +#define NR_TESTS 10 + +unsigned int srcrand; + +#if defined(__i386) || defined(__x86_64) + +static inline int fls(int x) +{ + int r; + asm("bsrl %1,%0\n\t" + "cmovzl %2,%0" + : "=&r" (r) : "rm" (x), "rm" (-1)); + return r + 1; +} + +#elif defined(__PPC__) + +static __inline__ int fls(unsigned int x) +{ + int lz; + + asm ("cntlzw %0,%1" : "=r" (lz) : "r" (x)); + return 32 - lz; +} + +#else + +static int fls(unsigned int x) +{ + int r = 32; + + if (!x) + return 0; + if (!(x & 0xFFFF0000U)) { + x <<= 16; + r -= 16; + } + if (!(x & 0xFF000000U)) { + x <<= 8; + r -= 8; + } + if (!(x & 0xF0000000U)) { + x <<= 4; + r -= 4; + } + if (!(x & 0xC0000000U)) { + x <<= 2; + r -= 2; + } + if (!(x & 0x80000000U)) { + x <<= 1; + r -= 1; + } + return r; +} + +#endif + +#define print_byte_array(c, len) \ +do { \ + unsigned long i; \ + \ + for (i = 0; i < (len); i++) { \ + printf("0x%X", (c)[i]); \ + if (i != (len) - 1) \ + printf(" "); \ + } \ + printf("\n"); \ +} while (0) + +#define init_byte_array(c, len, val) \ +do { \ + unsigned long i; \ + \ + for (i = 0; i < (len); i++) \ + (c)[i] = (val); \ +} while (0) + +int run_test_unsigned(void) +{ + unsigned int src, nrbits; + union { + unsigned char c[TEST_LEN]; + unsigned short s[TEST_LEN/sizeof(unsigned short)]; + unsigned int i[TEST_LEN/sizeof(unsigned int)]; + unsigned long l[TEST_LEN/sizeof(unsigned long)]; + unsigned long long ll[TEST_LEN/sizeof(unsigned long long)]; + } target; + unsigned long long readval; + unsigned int s, l; + int err = 0; + + printf("Running unsigned test with 0x%X\n", srcrand); + + src = srcrand; + nrbits = fls(src); + + for (s = 0; s < CHAR_BIT * TEST_LEN; s++) { + for (l = nrbits; l < (CHAR_BIT * TEST_LEN) - s; l++) { + init_byte_array(target.c, TEST_LEN, 0xFF); + bt_bitfield_write(target.c, unsigned char, s, l, src); + bt_bitfield_read(target.c, unsigned char, s, l, &readval); + if (readval != src) { + printf("Error (bytewise) src %X read %llX shift %d len %d\n", + src, readval, s, l); + print_byte_array(target.c, TEST_LEN); + err = 1; + } + + init_byte_array(target.c, TEST_LEN, 0xFF); + bt_bitfield_write(target.s, unsigned short, s, l, src); + bt_bitfield_read(target.c, unsigned char, s, l, &readval); + if (readval != src) { + printf("Error (shortwise) src %X read %llX shift %d len %d\n", + src, readval, s, l); + print_byte_array(target.c, TEST_LEN); + err = 1; + } + + init_byte_array(target.c, TEST_LEN, 0xFF); + bt_bitfield_write(target.i, unsigned int, s, l, src); + bt_bitfield_read(target.c, unsigned char, s, l, &readval); + if (readval != src) { + printf("Error (intwise) src %X read %llX shift %d len %d\n", + src, readval, s, l); + print_byte_array(target.c, TEST_LEN); + err = 1; + } + + init_byte_array(target.c, TEST_LEN, 0xFF); + bt_bitfield_write(target.l, unsigned long, s, l, src); + bt_bitfield_read(target.c, unsigned char, s, l, &readval); + if (readval != src) { + printf("Error (longwise) src %X read %llX shift %d len %d\n", + src, readval, s, l); + print_byte_array(target.c, TEST_LEN); + err = 1; + } + + init_byte_array(target.c, TEST_LEN, 0xFF); + bt_bitfield_write(target.ll, unsigned long long, s, l, src); + bt_bitfield_read(target.c, unsigned char, s, l, &readval); + if (readval != src) { + printf("Error (longlongwise) src %X read %llX shift %d len %d\n", + src, readval, s, l); + print_byte_array(target.c, TEST_LEN); + err = 1; + } + } + } + if (!err) + printf("Success!\n"); + else + printf("Failed!\n"); + return err; +} + +int run_test_signed(void) +{ + int src, nrbits; + union { + signed char c[TEST_LEN]; + short s[TEST_LEN/sizeof(short)]; + int i[TEST_LEN/sizeof(int)]; + long l[TEST_LEN/sizeof(long)]; + long long ll[TEST_LEN/sizeof(long long)]; + } target; + long long readval; + unsigned int s, l; + int err = 0; + + printf("Running signed test with 0x%X\n", srcrand); + + src = srcrand; + if (src & 0x80000000U) + nrbits = fls(~src) + 1; /* Find least significant bit conveying sign */ + else + nrbits = fls(src) + 1; /* Keep sign at 0 */ + + for (s = 0; s < 8 * TEST_LEN; s++) { + for (l = nrbits; l < (8 * TEST_LEN) - s; l++) { + init_byte_array(target.c, TEST_LEN, 0x0); + bt_bitfield_write(target.c, signed char, s, l, src); + bt_bitfield_read(target.c, signed char, s, l, &readval); + if (readval != src) { + printf("Error (bytewise) src %X read %llX shift %d len %d\n", + src, readval, s, l); + print_byte_array(target.c, TEST_LEN); + err = 1; + } + + init_byte_array(target.c, TEST_LEN, 0x0); + bt_bitfield_write(target.s, short, s, l, src); + bt_bitfield_read(target.c, signed char, s, l, &readval); + if (readval != src) { + printf("Error (shortwise) src %X read %llX shift %d len %d\n", + src, readval, s, l); + print_byte_array(target.c, TEST_LEN); + err = 1; + } + + init_byte_array(target.c, TEST_LEN, 0x0); + bt_bitfield_write(target.i, int, s, l, src); + bt_bitfield_read(target.c, signed char, s, l, &readval); + if (readval != src) { + printf("Error (intwise) src %X read %llX shift %d len %d\n", + src, readval, s, l); + print_byte_array(target.c, TEST_LEN); + err = 1; + } + + init_byte_array(target.c, TEST_LEN, 0x0); + bt_bitfield_write(target.l, long, s, l, src); + bt_bitfield_read(target.c, signed char, s, l, &readval); + if (readval != src) { + printf("Error (longwise) src %X read %llX shift %d len %d\n", + src, readval, s, l); + print_byte_array(target.c, TEST_LEN); + err = 1; + } + + init_byte_array(target.c, TEST_LEN, 0x0); + bt_bitfield_write(target.ll, long long, s, l, src); + bt_bitfield_read(target.c, signed char, s, l, &readval); + if (readval != src) { + printf("Error (longlongwise) src %X read %llX shift %d len %d\n", + src, readval, s, l); + print_byte_array(target.c, TEST_LEN); + err = 1; + } + } + } + if (!err) + printf("Success!\n"); + else + printf("Failed!\n"); + return err; +} + +int run_test(void) +{ + int err = 0; + int i; + + srand(time(NULL)); + + srcrand = 0; + err |= run_test_unsigned(); + srcrand = 0; + err |= run_test_signed(); + srcrand = 1; + err |= run_test_unsigned(); + srcrand = ~0U; + err |= run_test_unsigned(); + srcrand = -1; + err |= run_test_signed(); + srcrand = (int)0x80000000U; + err |= run_test_signed(); + + for (i = 0; i < NR_TESTS; i++) { + srcrand = rand(); + err |= run_test_unsigned(); + err |= run_test_signed(); + } + return err; +} + +int main(int argc, char **argv) +{ + unsigned long src; + unsigned int shift, len; + int ret; + union { + unsigned char c[8]; + unsigned short s[4]; + unsigned int i[2]; + unsigned long l[2]; + unsigned long long ll[1]; + } target; + unsigned long long readval; + + if (argc > 1) + src = atoi(argv[1]); + else + src = 0x12345678; + if (argc > 2) + shift = atoi(argv[2]); + else + shift = 12; + if (argc > 3) + len = atoi(argv[3]); + else + len = 40; + + target.i[0] = 0xFFFFFFFF; + target.i[1] = 0xFFFFFFFF; + bt_bitfield_write(target.c, unsigned char, shift, len, src); + printf("bytewise\n"); + print_byte_array(target.c, 8); + + target.i[0] = 0xFFFFFFFF; + target.i[1] = 0xFFFFFFFF; + bt_bitfield_write(target.s, unsigned short, shift, len, src); + printf("shortwise\n"); + print_byte_array(target.c, 8); + + target.i[0] = 0xFFFFFFFF; + target.i[1] = 0xFFFFFFFF; + bt_bitfield_write(target.i, unsigned int, shift, len, src); + printf("intwise\n"); + print_byte_array(target.c, 8); + + target.i[0] = 0xFFFFFFFF; + target.i[1] = 0xFFFFFFFF; + bt_bitfield_write(target.l, unsigned long, shift, len, src); + printf("longwise\n"); + print_byte_array(target.c, 8); + + target.i[0] = 0xFFFFFFFF; + target.i[1] = 0xFFFFFFFF; + bt_bitfield_write(target.ll, unsigned long long, shift, len, src); + printf("lluwise\n"); + print_byte_array(target.c, 8); + + bt_bitfield_read(target.c, unsigned char, shift, len, &readval); + printf("read: %llX\n", readval); + + ret = run_test(); + + return ret; +} diff --git a/tests/runall.sh b/tests/runall.sh index b2af656..9e0bdca 100755 --- a/tests/runall.sh +++ b/tests/runall.sh @@ -53,13 +53,6 @@ function run_babeltrace () return $? } -echo -e "Running test-bitfield..." -./test-bitfield -test_check -if [ $? -ne 0 ]; then - exit 1 -fi - #run babeltrace expects success echo -e "Running babeltrace without argument..." run_babeltrace diff --git a/tests/test-bitfield.c b/tests/test-bitfield.c deleted file mode 100644 index 3bf7568..0000000 --- a/tests/test-bitfield.c +++ /dev/null @@ -1,371 +0,0 @@ -/* - * test-bitfield.c - * - * BabelTrace - bitfield test program - * - * Copyright 2010 - Mathieu Desnoyers - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; under version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#define _GNU_SOURCE -#include -#include -#include -#include - -unsigned int glob; - -/* - * This function is only declared to show the size of a bitfield write in - * objdump. - */ -void fct(void) -{ - bt_bitfield_write(&glob, unsigned int, 12, 15, 0x12345678); -} - -/* Test array size, in bytes */ -#define TEST_LEN 128 -#define NR_TESTS 10 - -unsigned int srcrand; - -#if defined(__i386) || defined(__x86_64) - -static inline int fls(int x) -{ - int r; - asm("bsrl %1,%0\n\t" - "cmovzl %2,%0" - : "=&r" (r) : "rm" (x), "rm" (-1)); - return r + 1; -} - -#elif defined(__PPC__) - -static __inline__ int fls(unsigned int x) -{ - int lz; - - asm ("cntlzw %0,%1" : "=r" (lz) : "r" (x)); - return 32 - lz; -} - -#else - -static int fls(unsigned int x) -{ - int r = 32; - - if (!x) - return 0; - if (!(x & 0xFFFF0000U)) { - x <<= 16; - r -= 16; - } - if (!(x & 0xFF000000U)) { - x <<= 8; - r -= 8; - } - if (!(x & 0xF0000000U)) { - x <<= 4; - r -= 4; - } - if (!(x & 0xC0000000U)) { - x <<= 2; - r -= 2; - } - if (!(x & 0x80000000U)) { - x <<= 1; - r -= 1; - } - return r; -} - -#endif - -#define print_byte_array(c, len) \ -do { \ - unsigned long i; \ - \ - for (i = 0; i < (len); i++) { \ - printf("0x%X", (c)[i]); \ - if (i != (len) - 1) \ - printf(" "); \ - } \ - printf("\n"); \ -} while (0) - -#define init_byte_array(c, len, val) \ -do { \ - unsigned long i; \ - \ - for (i = 0; i < (len); i++) \ - (c)[i] = (val); \ -} while (0) - -int run_test_unsigned(void) -{ - unsigned int src, nrbits; - union { - unsigned char c[TEST_LEN]; - unsigned short s[TEST_LEN/sizeof(unsigned short)]; - unsigned int i[TEST_LEN/sizeof(unsigned int)]; - unsigned long l[TEST_LEN/sizeof(unsigned long)]; - unsigned long long ll[TEST_LEN/sizeof(unsigned long long)]; - } target; - unsigned long long readval; - unsigned int s, l; - int err = 0; - - printf("Running unsigned test with 0x%X\n", srcrand); - - src = srcrand; - nrbits = fls(src); - - for (s = 0; s < CHAR_BIT * TEST_LEN; s++) { - for (l = nrbits; l < (CHAR_BIT * TEST_LEN) - s; l++) { - init_byte_array(target.c, TEST_LEN, 0xFF); - bt_bitfield_write(target.c, unsigned char, s, l, src); - bt_bitfield_read(target.c, unsigned char, s, l, &readval); - if (readval != src) { - printf("Error (bytewise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; - } - - init_byte_array(target.c, TEST_LEN, 0xFF); - bt_bitfield_write(target.s, unsigned short, s, l, src); - bt_bitfield_read(target.c, unsigned char, s, l, &readval); - if (readval != src) { - printf("Error (shortwise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; - } - - init_byte_array(target.c, TEST_LEN, 0xFF); - bt_bitfield_write(target.i, unsigned int, s, l, src); - bt_bitfield_read(target.c, unsigned char, s, l, &readval); - if (readval != src) { - printf("Error (intwise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; - } - - init_byte_array(target.c, TEST_LEN, 0xFF); - bt_bitfield_write(target.l, unsigned long, s, l, src); - bt_bitfield_read(target.c, unsigned char, s, l, &readval); - if (readval != src) { - printf("Error (longwise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; - } - - init_byte_array(target.c, TEST_LEN, 0xFF); - bt_bitfield_write(target.ll, unsigned long long, s, l, src); - bt_bitfield_read(target.c, unsigned char, s, l, &readval); - if (readval != src) { - printf("Error (longlongwise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; - } - } - } - if (!err) - printf("Success!\n"); - else - printf("Failed!\n"); - return err; -} - -int run_test_signed(void) -{ - int src, nrbits; - union { - signed char c[TEST_LEN]; - short s[TEST_LEN/sizeof(short)]; - int i[TEST_LEN/sizeof(int)]; - long l[TEST_LEN/sizeof(long)]; - long long ll[TEST_LEN/sizeof(long long)]; - } target; - long long readval; - unsigned int s, l; - int err = 0; - - printf("Running signed test with 0x%X\n", srcrand); - - src = srcrand; - if (src & 0x80000000U) - nrbits = fls(~src) + 1; /* Find least significant bit conveying sign */ - else - nrbits = fls(src) + 1; /* Keep sign at 0 */ - - for (s = 0; s < 8 * TEST_LEN; s++) { - for (l = nrbits; l < (8 * TEST_LEN) - s; l++) { - init_byte_array(target.c, TEST_LEN, 0x0); - bt_bitfield_write(target.c, signed char, s, l, src); - bt_bitfield_read(target.c, signed char, s, l, &readval); - if (readval != src) { - printf("Error (bytewise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; - } - - init_byte_array(target.c, TEST_LEN, 0x0); - bt_bitfield_write(target.s, short, s, l, src); - bt_bitfield_read(target.c, signed char, s, l, &readval); - if (readval != src) { - printf("Error (shortwise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; - } - - init_byte_array(target.c, TEST_LEN, 0x0); - bt_bitfield_write(target.i, int, s, l, src); - bt_bitfield_read(target.c, signed char, s, l, &readval); - if (readval != src) { - printf("Error (intwise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; - } - - init_byte_array(target.c, TEST_LEN, 0x0); - bt_bitfield_write(target.l, long, s, l, src); - bt_bitfield_read(target.c, signed char, s, l, &readval); - if (readval != src) { - printf("Error (longwise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; - } - - init_byte_array(target.c, TEST_LEN, 0x0); - bt_bitfield_write(target.ll, long long, s, l, src); - bt_bitfield_read(target.c, signed char, s, l, &readval); - if (readval != src) { - printf("Error (longlongwise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; - } - } - } - if (!err) - printf("Success!\n"); - else - printf("Failed!\n"); - return err; -} - -int run_test(void) -{ - int err = 0; - int i; - - srand(time(NULL)); - - srcrand = 0; - err |= run_test_unsigned(); - srcrand = 0; - err |= run_test_signed(); - srcrand = 1; - err |= run_test_unsigned(); - srcrand = ~0U; - err |= run_test_unsigned(); - srcrand = -1; - err |= run_test_signed(); - srcrand = (int)0x80000000U; - err |= run_test_signed(); - - for (i = 0; i < NR_TESTS; i++) { - srcrand = rand(); - err |= run_test_unsigned(); - err |= run_test_signed(); - } - return err; -} - -int main(int argc, char **argv) -{ - unsigned long src; - unsigned int shift, len; - int ret; - union { - unsigned char c[8]; - unsigned short s[4]; - unsigned int i[2]; - unsigned long l[2]; - unsigned long long ll[1]; - } target; - unsigned long long readval; - - if (argc > 1) - src = atoi(argv[1]); - else - src = 0x12345678; - if (argc > 2) - shift = atoi(argv[2]); - else - shift = 12; - if (argc > 3) - len = atoi(argv[3]); - else - len = 40; - - target.i[0] = 0xFFFFFFFF; - target.i[1] = 0xFFFFFFFF; - bt_bitfield_write(target.c, unsigned char, shift, len, src); - printf("bytewise\n"); - print_byte_array(target.c, 8); - - target.i[0] = 0xFFFFFFFF; - target.i[1] = 0xFFFFFFFF; - bt_bitfield_write(target.s, unsigned short, shift, len, src); - printf("shortwise\n"); - print_byte_array(target.c, 8); - - target.i[0] = 0xFFFFFFFF; - target.i[1] = 0xFFFFFFFF; - bt_bitfield_write(target.i, unsigned int, shift, len, src); - printf("intwise\n"); - print_byte_array(target.c, 8); - - target.i[0] = 0xFFFFFFFF; - target.i[1] = 0xFFFFFFFF; - bt_bitfield_write(target.l, unsigned long, shift, len, src); - printf("longwise\n"); - print_byte_array(target.c, 8); - - target.i[0] = 0xFFFFFFFF; - target.i[1] = 0xFFFFFFFF; - bt_bitfield_write(target.ll, unsigned long long, shift, len, src); - printf("lluwise\n"); - print_byte_array(target.c, 8); - - bt_bitfield_read(target.c, unsigned char, shift, len, &readval); - printf("read: %llX\n", readval); - - ret = run_test(); - - return ret; -} -- 1.8.1.1 From jeremie.galarneau at efficios.com Thu Feb 7 16:40:53 2013 From: jeremie.galarneau at efficios.com (=?UTF-8?q?J=C3=A9r=C3=A9mie=20Galarneau?=) Date: Thu, 7 Feb 2013 16:40:53 -0500 Subject: [lttng-dev] [PATCH babeltrace 2/2] Convert the unit tests to the TAP format In-Reply-To: <1360273253-12401-1-git-send-email-jeremie.galarneau@efficios.com> References: <20130207174526.GA6632@Krystal> <1360273253-12401-1-git-send-email-jeremie.galarneau@efficios.com> Message-ID: <1360273253-12401-2-git-send-email-jeremie.galarneau@efficios.com> Signed-off-by: J?r?mie Galarneau --- tests/lib/Makefile.am | 2 + tests/lib/test-bitfield.c | 242 +++++++++++++++++++--------------------------- tests/runall.sh | 88 +++++++---------- 3 files changed, 139 insertions(+), 193 deletions(-) diff --git a/tests/lib/Makefile.am b/tests/lib/Makefile.am index 0613beb..01831de 100644 --- a/tests/lib/Makefile.am +++ b/tests/lib/Makefile.am @@ -8,6 +8,8 @@ test_seeks_LDADD = libtestcommon.a \ $(top_builddir)/lib/libbabeltrace.la \ $(top_builddir)/formats/ctf/libbabeltrace-ctf.la +test_bitfield_LDADD = libtestcommon.a + noinst_PROGRAMS = test-seeks test-bitfield test_seeks_SOURCES = test-seeks.c diff --git a/tests/lib/test-bitfield.c b/tests/lib/test-bitfield.c index 3bf7568..9b8e737 100644 --- a/tests/lib/test-bitfield.c +++ b/tests/lib/test-bitfield.c @@ -25,6 +25,8 @@ #include #include +#include "tap.h" + unsigned int glob; /* @@ -130,8 +132,6 @@ int run_test_unsigned(void) unsigned int s, l; int err = 0; - printf("Running unsigned test with 0x%X\n", srcrand); - src = srcrand; nrbits = fls(src); @@ -140,58 +140,38 @@ int run_test_unsigned(void) init_byte_array(target.c, TEST_LEN, 0xFF); bt_bitfield_write(target.c, unsigned char, s, l, src); bt_bitfield_read(target.c, unsigned char, s, l, &readval); - if (readval != src) { - printf("Error (bytewise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; - } + err = readval != src ? 1 : err; init_byte_array(target.c, TEST_LEN, 0xFF); bt_bitfield_write(target.s, unsigned short, s, l, src); bt_bitfield_read(target.c, unsigned char, s, l, &readval); - if (readval != src) { - printf("Error (shortwise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; - } + err = readval != src ? 1 : err; init_byte_array(target.c, TEST_LEN, 0xFF); bt_bitfield_write(target.i, unsigned int, s, l, src); bt_bitfield_read(target.c, unsigned char, s, l, &readval); - if (readval != src) { - printf("Error (intwise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; - } + err = readval != src ? 1 : err; init_byte_array(target.c, TEST_LEN, 0xFF); bt_bitfield_write(target.l, unsigned long, s, l, src); bt_bitfield_read(target.c, unsigned char, s, l, &readval); - if (readval != src) { - printf("Error (longwise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; - } + err = readval != src ? 1 : err; init_byte_array(target.c, TEST_LEN, 0xFF); bt_bitfield_write(target.ll, unsigned long long, s, l, src); bt_bitfield_read(target.c, unsigned char, s, l, &readval); - if (readval != src) { - printf("Error (longlongwise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; + err = readval != src ? 1 : err; + + if (err) { + goto end; } } } - if (!err) - printf("Success!\n"); - else - printf("Failed!\n"); +end: + ok(err == 0, "Writing and reading back 0x%X, unsigned", src); + if (err) { + printf("# Failed with start=%i and length=%i\n", s, l); + } return err; } @@ -209,163 +189,141 @@ int run_test_signed(void) unsigned int s, l; int err = 0; - printf("Running signed test with 0x%X\n", srcrand); - src = srcrand; if (src & 0x80000000U) nrbits = fls(~src) + 1; /* Find least significant bit conveying sign */ else nrbits = fls(src) + 1; /* Keep sign at 0 */ - for (s = 0; s < 8 * TEST_LEN; s++) { - for (l = nrbits; l < (8 * TEST_LEN) - s; l++) { + for (s = 0; s < CHAR_BIT * TEST_LEN; s++) { + for (l = nrbits; l < (CHAR_BIT * TEST_LEN) - s; l++) { init_byte_array(target.c, TEST_LEN, 0x0); bt_bitfield_write(target.c, signed char, s, l, src); bt_bitfield_read(target.c, signed char, s, l, &readval); - if (readval != src) { - printf("Error (bytewise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; - } + err = readval != src ? 1 : err; init_byte_array(target.c, TEST_LEN, 0x0); bt_bitfield_write(target.s, short, s, l, src); bt_bitfield_read(target.c, signed char, s, l, &readval); - if (readval != src) { - printf("Error (shortwise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; - } + err = readval != src ? 1 : err; init_byte_array(target.c, TEST_LEN, 0x0); bt_bitfield_write(target.i, int, s, l, src); bt_bitfield_read(target.c, signed char, s, l, &readval); - if (readval != src) { - printf("Error (intwise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; - } + err = readval != src ? 1 : err; init_byte_array(target.c, TEST_LEN, 0x0); bt_bitfield_write(target.l, long, s, l, src); bt_bitfield_read(target.c, signed char, s, l, &readval); - if (readval != src) { - printf("Error (longwise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; - } + err = readval != src ? 1 : err; init_byte_array(target.c, TEST_LEN, 0x0); bt_bitfield_write(target.ll, long long, s, l, src); bt_bitfield_read(target.c, signed char, s, l, &readval); - if (readval != src) { - printf("Error (longlongwise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; + err = readval != src ? 1 : err; + + if (err) { + goto end; } } } - if (!err) - printf("Success!\n"); - else - printf("Failed!\n"); +end: + ok(err == 0, "Writing and reading back 0x%X, signed", src); + if (err) { + printf("#Failed with start=%i and length=%i\n", s, l); + } return err; } -int run_test(void) +void run_test(void) { - int err = 0; int i; + plan_tests(NR_TESTS * 2 + 6); srand(time(NULL)); srcrand = 0; - err |= run_test_unsigned(); + run_test_unsigned(); srcrand = 0; - err |= run_test_signed(); + run_test_signed(); + srcrand = 1; - err |= run_test_unsigned(); + run_test_unsigned(); + srcrand = ~0U; - err |= run_test_unsigned(); + run_test_unsigned(); + srcrand = -1; - err |= run_test_signed(); + run_test_signed(); + srcrand = (int)0x80000000U; - err |= run_test_signed(); + run_test_signed(); for (i = 0; i < NR_TESTS; i++) { srcrand = rand(); - err |= run_test_unsigned(); - err |= run_test_signed(); + run_test_unsigned(); + run_test_signed(); } - return err; } int main(int argc, char **argv) { - unsigned long src; - unsigned int shift, len; - int ret; - union { - unsigned char c[8]; - unsigned short s[4]; - unsigned int i[2]; - unsigned long l[2]; - unsigned long long ll[1]; - } target; - unsigned long long readval; + if (argc > 1) { + /* Run interactive tests */ + unsigned long src; + unsigned int shift, len; + union { + unsigned char c[8]; + unsigned short s[4]; + unsigned int i[2]; + unsigned long l[2]; + unsigned long long ll[1]; + } target; + unsigned long long readval; - if (argc > 1) src = atoi(argv[1]); - else - src = 0x12345678; - if (argc > 2) - shift = atoi(argv[2]); - else - shift = 12; - if (argc > 3) - len = atoi(argv[3]); - else - len = 40; - - target.i[0] = 0xFFFFFFFF; - target.i[1] = 0xFFFFFFFF; - bt_bitfield_write(target.c, unsigned char, shift, len, src); - printf("bytewise\n"); - print_byte_array(target.c, 8); - - target.i[0] = 0xFFFFFFFF; - target.i[1] = 0xFFFFFFFF; - bt_bitfield_write(target.s, unsigned short, shift, len, src); - printf("shortwise\n"); - print_byte_array(target.c, 8); - - target.i[0] = 0xFFFFFFFF; - target.i[1] = 0xFFFFFFFF; - bt_bitfield_write(target.i, unsigned int, shift, len, src); - printf("intwise\n"); - print_byte_array(target.c, 8); - - target.i[0] = 0xFFFFFFFF; - target.i[1] = 0xFFFFFFFF; - bt_bitfield_write(target.l, unsigned long, shift, len, src); - printf("longwise\n"); - print_byte_array(target.c, 8); - - target.i[0] = 0xFFFFFFFF; - target.i[1] = 0xFFFFFFFF; - bt_bitfield_write(target.ll, unsigned long long, shift, len, src); - printf("lluwise\n"); - print_byte_array(target.c, 8); - - bt_bitfield_read(target.c, unsigned char, shift, len, &readval); - printf("read: %llX\n", readval); - - ret = run_test(); - - return ret; + if (argc > 2) + shift = atoi(argv[2]); + else + shift = 12; + if (argc > 3) + len = atoi(argv[3]); + else + len = 40; + + init_byte_array(target.c, 8, 0xFF); + bt_bitfield_write(target.c, unsigned char, shift, len, src); + printf("bytewise\n"); + print_byte_array(target.c, 8); + + init_byte_array(target.c, 8, 0xFF); + bt_bitfield_write(target.s, unsigned short, shift, len, src); + printf("shortwise\n"); + print_byte_array(target.c, 8); + + init_byte_array(target.c, 8, 0xFF); + bt_bitfield_write(target.i, unsigned int, shift, len, src); + printf("intwise\n"); + print_byte_array(target.c, 8); + + init_byte_array(target.c, 8, 0xFF); + bt_bitfield_write(target.l, unsigned long, shift, len, src); + printf("longwise\n"); + print_byte_array(target.c, 8); + + init_byte_array(target.c, 8, 0xFF); + bt_bitfield_write(target.ll, unsigned long long, shift, len, src); + printf("lluwise\n"); + print_byte_array(target.c, 8); + + bt_bitfield_read(target.c, unsigned char, shift, len, &readval); + printf("read: %llX\n", readval); + print_byte_array(target.c, 8); + + return 0; + } + + /* Run tap-formated tests */ + run_test(); + return exit_status(); } diff --git a/tests/runall.sh b/tests/runall.sh index 9e0bdca..c10e88a 100755 --- a/tests/runall.sh +++ b/tests/runall.sh @@ -5,44 +5,20 @@ DIR=$(readlink -f ${TESTDIR}) BABELTRACE_BIN=${DIR}/../converter/babeltrace CTF_TRACES=${DIR}/ctf-traces -function print_ok () -{ - # Check if we are a terminal - if [ -t 1 ]; then - echo -e "\e[1;32mOK\e[0m" - else - echo -e "OK" - fi -} - -function print_fail () -{ - # Check if we are a terminal - if [ -t 1 ]; then - echo -e "\e[1;31mFAIL\e[0m" - else - echo -e "FAIL" - fi -} - -function test_check () +function test_check_success () { if [ $? -ne 0 ] ; then - print_fail return 1 else - print_ok return 0 fi } function test_check_fail () { - if [ $? -ne 1 ] ; then - print_fail + if [ $? -eq 0 ] ; then return 1 else - print_ok return 0 fi } @@ -53,38 +29,48 @@ function run_babeltrace () return $? } -#run babeltrace expects success -echo -e "Running babeltrace without argument..." -run_babeltrace -test_check -if [ $? -ne 0 ]; then - exit 1 -fi - -for a in ${CTF_TRACES}/succeed/*; do - echo -e "Running babeltrace for trace ${a}..." - run_babeltrace ${a} - test_check - if [ $? -ne 0 ]; then +function print_test_result () +{ + if [ $# -ne 3 ] ; then + echo "Invalid arguments provided" exit 1 fi -done -#run babeltrace expects failure -echo -e "Running babeltrace with bogus argument..." + if [ ${2} -eq 0 ] ; then + echo -n "ok" + else + echo -n "not ok" + fi + echo -e " "${1}" - "${3} +} + +successTraces=(${CTF_TRACES}/succeed/*) +failTraces=(${CTF_TRACES}/fail/*) +testCount=$((2 + ${#successTraces[@]} + ${#failTraces[@]})) + +currentTestIndex=1 +echo -e 1..${testCount} + +#run babeltrace, expects success +run_babeltrace +test_check_success +print_test_result $((currentTestIndex++)) $? "Running babeltrace without arguments" + +#run babeltrace with a bogus argument, expects failure run_babeltrace --bogusarg test_check_fail -if [ $? -ne 0 ]; then - exit 1 -fi +print_test_result $((currentTestIndex++)) $? "Running babeltrace with a bogus argument" + +for tracePath in ${successTraces[@]}; do + run_babeltrace ${tracePath} + test_check_success + print_test_result $((currentTestIndex++)) $? "Running babeltrace with trace ${tracePath}" +done -for a in ${CTF_TRACES}/fail/*; do - echo -e "Running babeltrace for trace ${a}..." - run_babeltrace ${a} +for tracePath in ${failTraces[@]}; do + run_babeltrace ${tracePath} test_check_fail - if [ $? -ne 0 ]; then - exit 1 - fi + print_test_result $((currentTestIndex++)) $? "Running babeltrace with trace ${tracePath}" done exit 0 -- 1.8.1.1 From mathieu.desnoyers at efficios.com Thu Feb 7 17:31:58 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 7 Feb 2013 17:31:58 -0500 Subject: [lttng-dev] [PATCH babeltrace 1/2] Move the bitfield test to tests/lib/ In-Reply-To: <1360273253-12401-1-git-send-email-jeremie.galarneau@efficios.com> References: <20130207174526.GA6632@Krystal> <1360273253-12401-1-git-send-email-jeremie.galarneau@efficios.com> Message-ID: <20130207223158.GA10074@Krystal> * J?r?mie Galarneau (jeremie.galarneau at efficios.com) wrote: > > Signed-off-by: J?r?mie Galarneau merged, thanks! Mathieu > --- > .gitignore | 2 +- > tests/Makefile.am | 4 - > tests/lib/Makefile.am | 3 +- > tests/lib/runall.sh | 5 +- > tests/lib/test-bitfield.c | 371 ++++++++++++++++++++++++++++++++++++++++++++++ > tests/runall.sh | 7 - > tests/test-bitfield.c | 371 ---------------------------------------------- > 7 files changed, 378 insertions(+), 385 deletions(-) > create mode 100644 tests/lib/test-bitfield.c > delete mode 100644 tests/test-bitfield.c > > diff --git a/.gitignore b/.gitignore > index 03443df..752308e 100644 > --- a/.gitignore > +++ b/.gitignore > @@ -1,4 +1,4 @@ > -/tests/test-bitfield > +/tests/lib/test-bitfield > /tests/lib/test-seeks > *.o > *.a > diff --git a/tests/Makefile.am b/tests/Makefile.am > index 47891e9..816fa66 100644 > --- a/tests/Makefile.am > +++ b/tests/Makefile.am > @@ -2,10 +2,6 @@ AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include > > SUBDIRS = lib > > -noinst_PROGRAMS = test-bitfield > - > -test_bitfield_SOURCES = test-bitfield.c > - > EXTRA_DIST = runall.sh ctf-traces/** > > check-am: > diff --git a/tests/lib/Makefile.am b/tests/lib/Makefile.am > index e9e264b..0613beb 100644 > --- a/tests/lib/Makefile.am > +++ b/tests/lib/Makefile.am > @@ -8,9 +8,10 @@ test_seeks_LDADD = libtestcommon.a \ > $(top_builddir)/lib/libbabeltrace.la \ > $(top_builddir)/formats/ctf/libbabeltrace-ctf.la > > -noinst_PROGRAMS = test-seeks > +noinst_PROGRAMS = test-seeks test-bitfield > > test_seeks_SOURCES = test-seeks.c > +test_bitfield_SOURCES = test-bitfield.c > > EXTRA_DIST = README.tap runall.sh > > diff --git a/tests/lib/runall.sh b/tests/lib/runall.sh > index 34503bb..b5522ad 100755 > --- a/tests/lib/runall.sh > +++ b/tests/lib/runall.sh > @@ -3,4 +3,7 @@ > # With a trace than contains empty packets > ./test-seeks ../ctf-traces/succeed/wk-heartbeat-u/ 1351532897586558519 1351532897591331194 > # With a bigger trace > -./test-seeks ../ctf-traces/succeed/lttng-modules-2.0-pre5/ 61334174524234 61336381998396 > \ No newline at end of file > +./test-seeks ../ctf-traces/succeed/lttng-modules-2.0-pre5/ 61334174524234 61336381998396 > + > +# run bitfield tests > +./test-bitfield > diff --git a/tests/lib/test-bitfield.c b/tests/lib/test-bitfield.c > new file mode 100644 > index 0000000..3bf7568 > --- /dev/null > +++ b/tests/lib/test-bitfield.c > @@ -0,0 +1,371 @@ > +/* > + * test-bitfield.c > + * > + * BabelTrace - bitfield test program > + * > + * Copyright 2010 - Mathieu Desnoyers > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License as published by > + * the Free Software Foundation; under version 2 of the License. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License along > + * with this program; if not, write to the Free Software Foundation, Inc., > + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > + */ > + > +#define _GNU_SOURCE > +#include > +#include > +#include > +#include > + > +unsigned int glob; > + > +/* > + * This function is only declared to show the size of a bitfield write in > + * objdump. > + */ > +void fct(void) > +{ > + bt_bitfield_write(&glob, unsigned int, 12, 15, 0x12345678); > +} > + > +/* Test array size, in bytes */ > +#define TEST_LEN 128 > +#define NR_TESTS 10 > + > +unsigned int srcrand; > + > +#if defined(__i386) || defined(__x86_64) > + > +static inline int fls(int x) > +{ > + int r; > + asm("bsrl %1,%0\n\t" > + "cmovzl %2,%0" > + : "=&r" (r) : "rm" (x), "rm" (-1)); > + return r + 1; > +} > + > +#elif defined(__PPC__) > + > +static __inline__ int fls(unsigned int x) > +{ > + int lz; > + > + asm ("cntlzw %0,%1" : "=r" (lz) : "r" (x)); > + return 32 - lz; > +} > + > +#else > + > +static int fls(unsigned int x) > +{ > + int r = 32; > + > + if (!x) > + return 0; > + if (!(x & 0xFFFF0000U)) { > + x <<= 16; > + r -= 16; > + } > + if (!(x & 0xFF000000U)) { > + x <<= 8; > + r -= 8; > + } > + if (!(x & 0xF0000000U)) { > + x <<= 4; > + r -= 4; > + } > + if (!(x & 0xC0000000U)) { > + x <<= 2; > + r -= 2; > + } > + if (!(x & 0x80000000U)) { > + x <<= 1; > + r -= 1; > + } > + return r; > +} > + > +#endif > + > +#define print_byte_array(c, len) \ > +do { \ > + unsigned long i; \ > + \ > + for (i = 0; i < (len); i++) { \ > + printf("0x%X", (c)[i]); \ > + if (i != (len) - 1) \ > + printf(" "); \ > + } \ > + printf("\n"); \ > +} while (0) > + > +#define init_byte_array(c, len, val) \ > +do { \ > + unsigned long i; \ > + \ > + for (i = 0; i < (len); i++) \ > + (c)[i] = (val); \ > +} while (0) > + > +int run_test_unsigned(void) > +{ > + unsigned int src, nrbits; > + union { > + unsigned char c[TEST_LEN]; > + unsigned short s[TEST_LEN/sizeof(unsigned short)]; > + unsigned int i[TEST_LEN/sizeof(unsigned int)]; > + unsigned long l[TEST_LEN/sizeof(unsigned long)]; > + unsigned long long ll[TEST_LEN/sizeof(unsigned long long)]; > + } target; > + unsigned long long readval; > + unsigned int s, l; > + int err = 0; > + > + printf("Running unsigned test with 0x%X\n", srcrand); > + > + src = srcrand; > + nrbits = fls(src); > + > + for (s = 0; s < CHAR_BIT * TEST_LEN; s++) { > + for (l = nrbits; l < (CHAR_BIT * TEST_LEN) - s; l++) { > + init_byte_array(target.c, TEST_LEN, 0xFF); > + bt_bitfield_write(target.c, unsigned char, s, l, src); > + bt_bitfield_read(target.c, unsigned char, s, l, &readval); > + if (readval != src) { > + printf("Error (bytewise) src %X read %llX shift %d len %d\n", > + src, readval, s, l); > + print_byte_array(target.c, TEST_LEN); > + err = 1; > + } > + > + init_byte_array(target.c, TEST_LEN, 0xFF); > + bt_bitfield_write(target.s, unsigned short, s, l, src); > + bt_bitfield_read(target.c, unsigned char, s, l, &readval); > + if (readval != src) { > + printf("Error (shortwise) src %X read %llX shift %d len %d\n", > + src, readval, s, l); > + print_byte_array(target.c, TEST_LEN); > + err = 1; > + } > + > + init_byte_array(target.c, TEST_LEN, 0xFF); > + bt_bitfield_write(target.i, unsigned int, s, l, src); > + bt_bitfield_read(target.c, unsigned char, s, l, &readval); > + if (readval != src) { > + printf("Error (intwise) src %X read %llX shift %d len %d\n", > + src, readval, s, l); > + print_byte_array(target.c, TEST_LEN); > + err = 1; > + } > + > + init_byte_array(target.c, TEST_LEN, 0xFF); > + bt_bitfield_write(target.l, unsigned long, s, l, src); > + bt_bitfield_read(target.c, unsigned char, s, l, &readval); > + if (readval != src) { > + printf("Error (longwise) src %X read %llX shift %d len %d\n", > + src, readval, s, l); > + print_byte_array(target.c, TEST_LEN); > + err = 1; > + } > + > + init_byte_array(target.c, TEST_LEN, 0xFF); > + bt_bitfield_write(target.ll, unsigned long long, s, l, src); > + bt_bitfield_read(target.c, unsigned char, s, l, &readval); > + if (readval != src) { > + printf("Error (longlongwise) src %X read %llX shift %d len %d\n", > + src, readval, s, l); > + print_byte_array(target.c, TEST_LEN); > + err = 1; > + } > + } > + } > + if (!err) > + printf("Success!\n"); > + else > + printf("Failed!\n"); > + return err; > +} > + > +int run_test_signed(void) > +{ > + int src, nrbits; > + union { > + signed char c[TEST_LEN]; > + short s[TEST_LEN/sizeof(short)]; > + int i[TEST_LEN/sizeof(int)]; > + long l[TEST_LEN/sizeof(long)]; > + long long ll[TEST_LEN/sizeof(long long)]; > + } target; > + long long readval; > + unsigned int s, l; > + int err = 0; > + > + printf("Running signed test with 0x%X\n", srcrand); > + > + src = srcrand; > + if (src & 0x80000000U) > + nrbits = fls(~src) + 1; /* Find least significant bit conveying sign */ > + else > + nrbits = fls(src) + 1; /* Keep sign at 0 */ > + > + for (s = 0; s < 8 * TEST_LEN; s++) { > + for (l = nrbits; l < (8 * TEST_LEN) - s; l++) { > + init_byte_array(target.c, TEST_LEN, 0x0); > + bt_bitfield_write(target.c, signed char, s, l, src); > + bt_bitfield_read(target.c, signed char, s, l, &readval); > + if (readval != src) { > + printf("Error (bytewise) src %X read %llX shift %d len %d\n", > + src, readval, s, l); > + print_byte_array(target.c, TEST_LEN); > + err = 1; > + } > + > + init_byte_array(target.c, TEST_LEN, 0x0); > + bt_bitfield_write(target.s, short, s, l, src); > + bt_bitfield_read(target.c, signed char, s, l, &readval); > + if (readval != src) { > + printf("Error (shortwise) src %X read %llX shift %d len %d\n", > + src, readval, s, l); > + print_byte_array(target.c, TEST_LEN); > + err = 1; > + } > + > + init_byte_array(target.c, TEST_LEN, 0x0); > + bt_bitfield_write(target.i, int, s, l, src); > + bt_bitfield_read(target.c, signed char, s, l, &readval); > + if (readval != src) { > + printf("Error (intwise) src %X read %llX shift %d len %d\n", > + src, readval, s, l); > + print_byte_array(target.c, TEST_LEN); > + err = 1; > + } > + > + init_byte_array(target.c, TEST_LEN, 0x0); > + bt_bitfield_write(target.l, long, s, l, src); > + bt_bitfield_read(target.c, signed char, s, l, &readval); > + if (readval != src) { > + printf("Error (longwise) src %X read %llX shift %d len %d\n", > + src, readval, s, l); > + print_byte_array(target.c, TEST_LEN); > + err = 1; > + } > + > + init_byte_array(target.c, TEST_LEN, 0x0); > + bt_bitfield_write(target.ll, long long, s, l, src); > + bt_bitfield_read(target.c, signed char, s, l, &readval); > + if (readval != src) { > + printf("Error (longlongwise) src %X read %llX shift %d len %d\n", > + src, readval, s, l); > + print_byte_array(target.c, TEST_LEN); > + err = 1; > + } > + } > + } > + if (!err) > + printf("Success!\n"); > + else > + printf("Failed!\n"); > + return err; > +} > + > +int run_test(void) > +{ > + int err = 0; > + int i; > + > + srand(time(NULL)); > + > + srcrand = 0; > + err |= run_test_unsigned(); > + srcrand = 0; > + err |= run_test_signed(); > + srcrand = 1; > + err |= run_test_unsigned(); > + srcrand = ~0U; > + err |= run_test_unsigned(); > + srcrand = -1; > + err |= run_test_signed(); > + srcrand = (int)0x80000000U; > + err |= run_test_signed(); > + > + for (i = 0; i < NR_TESTS; i++) { > + srcrand = rand(); > + err |= run_test_unsigned(); > + err |= run_test_signed(); > + } > + return err; > +} > + > +int main(int argc, char **argv) > +{ > + unsigned long src; > + unsigned int shift, len; > + int ret; > + union { > + unsigned char c[8]; > + unsigned short s[4]; > + unsigned int i[2]; > + unsigned long l[2]; > + unsigned long long ll[1]; > + } target; > + unsigned long long readval; > + > + if (argc > 1) > + src = atoi(argv[1]); > + else > + src = 0x12345678; > + if (argc > 2) > + shift = atoi(argv[2]); > + else > + shift = 12; > + if (argc > 3) > + len = atoi(argv[3]); > + else > + len = 40; > + > + target.i[0] = 0xFFFFFFFF; > + target.i[1] = 0xFFFFFFFF; > + bt_bitfield_write(target.c, unsigned char, shift, len, src); > + printf("bytewise\n"); > + print_byte_array(target.c, 8); > + > + target.i[0] = 0xFFFFFFFF; > + target.i[1] = 0xFFFFFFFF; > + bt_bitfield_write(target.s, unsigned short, shift, len, src); > + printf("shortwise\n"); > + print_byte_array(target.c, 8); > + > + target.i[0] = 0xFFFFFFFF; > + target.i[1] = 0xFFFFFFFF; > + bt_bitfield_write(target.i, unsigned int, shift, len, src); > + printf("intwise\n"); > + print_byte_array(target.c, 8); > + > + target.i[0] = 0xFFFFFFFF; > + target.i[1] = 0xFFFFFFFF; > + bt_bitfield_write(target.l, unsigned long, shift, len, src); > + printf("longwise\n"); > + print_byte_array(target.c, 8); > + > + target.i[0] = 0xFFFFFFFF; > + target.i[1] = 0xFFFFFFFF; > + bt_bitfield_write(target.ll, unsigned long long, shift, len, src); > + printf("lluwise\n"); > + print_byte_array(target.c, 8); > + > + bt_bitfield_read(target.c, unsigned char, shift, len, &readval); > + printf("read: %llX\n", readval); > + > + ret = run_test(); > + > + return ret; > +} > diff --git a/tests/runall.sh b/tests/runall.sh > index b2af656..9e0bdca 100755 > --- a/tests/runall.sh > +++ b/tests/runall.sh > @@ -53,13 +53,6 @@ function run_babeltrace () > return $? > } > > -echo -e "Running test-bitfield..." > -./test-bitfield > -test_check > -if [ $? -ne 0 ]; then > - exit 1 > -fi > - > #run babeltrace expects success > echo -e "Running babeltrace without argument..." > run_babeltrace > diff --git a/tests/test-bitfield.c b/tests/test-bitfield.c > deleted file mode 100644 > index 3bf7568..0000000 > --- a/tests/test-bitfield.c > +++ /dev/null > @@ -1,371 +0,0 @@ > -/* > - * test-bitfield.c > - * > - * BabelTrace - bitfield test program > - * > - * Copyright 2010 - Mathieu Desnoyers > - * > - * This program is free software; you can redistribute it and/or modify > - * it under the terms of the GNU General Public License as published by > - * the Free Software Foundation; under version 2 of the License. > - * > - * This program is distributed in the hope that it will be useful, > - * but WITHOUT ANY WARRANTY; without even the implied warranty of > - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > - * GNU General Public License for more details. > - * > - * You should have received a copy of the GNU General Public License along > - * with this program; if not, write to the Free Software Foundation, Inc., > - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > - */ > - > -#define _GNU_SOURCE > -#include > -#include > -#include > -#include > - > -unsigned int glob; > - > -/* > - * This function is only declared to show the size of a bitfield write in > - * objdump. > - */ > -void fct(void) > -{ > - bt_bitfield_write(&glob, unsigned int, 12, 15, 0x12345678); > -} > - > -/* Test array size, in bytes */ > -#define TEST_LEN 128 > -#define NR_TESTS 10 > - > -unsigned int srcrand; > - > -#if defined(__i386) || defined(__x86_64) > - > -static inline int fls(int x) > -{ > - int r; > - asm("bsrl %1,%0\n\t" > - "cmovzl %2,%0" > - : "=&r" (r) : "rm" (x), "rm" (-1)); > - return r + 1; > -} > - > -#elif defined(__PPC__) > - > -static __inline__ int fls(unsigned int x) > -{ > - int lz; > - > - asm ("cntlzw %0,%1" : "=r" (lz) : "r" (x)); > - return 32 - lz; > -} > - > -#else > - > -static int fls(unsigned int x) > -{ > - int r = 32; > - > - if (!x) > - return 0; > - if (!(x & 0xFFFF0000U)) { > - x <<= 16; > - r -= 16; > - } > - if (!(x & 0xFF000000U)) { > - x <<= 8; > - r -= 8; > - } > - if (!(x & 0xF0000000U)) { > - x <<= 4; > - r -= 4; > - } > - if (!(x & 0xC0000000U)) { > - x <<= 2; > - r -= 2; > - } > - if (!(x & 0x80000000U)) { > - x <<= 1; > - r -= 1; > - } > - return r; > -} > - > -#endif > - > -#define print_byte_array(c, len) \ > -do { \ > - unsigned long i; \ > - \ > - for (i = 0; i < (len); i++) { \ > - printf("0x%X", (c)[i]); \ > - if (i != (len) - 1) \ > - printf(" "); \ > - } \ > - printf("\n"); \ > -} while (0) > - > -#define init_byte_array(c, len, val) \ > -do { \ > - unsigned long i; \ > - \ > - for (i = 0; i < (len); i++) \ > - (c)[i] = (val); \ > -} while (0) > - > -int run_test_unsigned(void) > -{ > - unsigned int src, nrbits; > - union { > - unsigned char c[TEST_LEN]; > - unsigned short s[TEST_LEN/sizeof(unsigned short)]; > - unsigned int i[TEST_LEN/sizeof(unsigned int)]; > - unsigned long l[TEST_LEN/sizeof(unsigned long)]; > - unsigned long long ll[TEST_LEN/sizeof(unsigned long long)]; > - } target; > - unsigned long long readval; > - unsigned int s, l; > - int err = 0; > - > - printf("Running unsigned test with 0x%X\n", srcrand); > - > - src = srcrand; > - nrbits = fls(src); > - > - for (s = 0; s < CHAR_BIT * TEST_LEN; s++) { > - for (l = nrbits; l < (CHAR_BIT * TEST_LEN) - s; l++) { > - init_byte_array(target.c, TEST_LEN, 0xFF); > - bt_bitfield_write(target.c, unsigned char, s, l, src); > - bt_bitfield_read(target.c, unsigned char, s, l, &readval); > - if (readval != src) { > - printf("Error (bytewise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > - } > - > - init_byte_array(target.c, TEST_LEN, 0xFF); > - bt_bitfield_write(target.s, unsigned short, s, l, src); > - bt_bitfield_read(target.c, unsigned char, s, l, &readval); > - if (readval != src) { > - printf("Error (shortwise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > - } > - > - init_byte_array(target.c, TEST_LEN, 0xFF); > - bt_bitfield_write(target.i, unsigned int, s, l, src); > - bt_bitfield_read(target.c, unsigned char, s, l, &readval); > - if (readval != src) { > - printf("Error (intwise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > - } > - > - init_byte_array(target.c, TEST_LEN, 0xFF); > - bt_bitfield_write(target.l, unsigned long, s, l, src); > - bt_bitfield_read(target.c, unsigned char, s, l, &readval); > - if (readval != src) { > - printf("Error (longwise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > - } > - > - init_byte_array(target.c, TEST_LEN, 0xFF); > - bt_bitfield_write(target.ll, unsigned long long, s, l, src); > - bt_bitfield_read(target.c, unsigned char, s, l, &readval); > - if (readval != src) { > - printf("Error (longlongwise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > - } > - } > - } > - if (!err) > - printf("Success!\n"); > - else > - printf("Failed!\n"); > - return err; > -} > - > -int run_test_signed(void) > -{ > - int src, nrbits; > - union { > - signed char c[TEST_LEN]; > - short s[TEST_LEN/sizeof(short)]; > - int i[TEST_LEN/sizeof(int)]; > - long l[TEST_LEN/sizeof(long)]; > - long long ll[TEST_LEN/sizeof(long long)]; > - } target; > - long long readval; > - unsigned int s, l; > - int err = 0; > - > - printf("Running signed test with 0x%X\n", srcrand); > - > - src = srcrand; > - if (src & 0x80000000U) > - nrbits = fls(~src) + 1; /* Find least significant bit conveying sign */ > - else > - nrbits = fls(src) + 1; /* Keep sign at 0 */ > - > - for (s = 0; s < 8 * TEST_LEN; s++) { > - for (l = nrbits; l < (8 * TEST_LEN) - s; l++) { > - init_byte_array(target.c, TEST_LEN, 0x0); > - bt_bitfield_write(target.c, signed char, s, l, src); > - bt_bitfield_read(target.c, signed char, s, l, &readval); > - if (readval != src) { > - printf("Error (bytewise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > - } > - > - init_byte_array(target.c, TEST_LEN, 0x0); > - bt_bitfield_write(target.s, short, s, l, src); > - bt_bitfield_read(target.c, signed char, s, l, &readval); > - if (readval != src) { > - printf("Error (shortwise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > - } > - > - init_byte_array(target.c, TEST_LEN, 0x0); > - bt_bitfield_write(target.i, int, s, l, src); > - bt_bitfield_read(target.c, signed char, s, l, &readval); > - if (readval != src) { > - printf("Error (intwise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > - } > - > - init_byte_array(target.c, TEST_LEN, 0x0); > - bt_bitfield_write(target.l, long, s, l, src); > - bt_bitfield_read(target.c, signed char, s, l, &readval); > - if (readval != src) { > - printf("Error (longwise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > - } > - > - init_byte_array(target.c, TEST_LEN, 0x0); > - bt_bitfield_write(target.ll, long long, s, l, src); > - bt_bitfield_read(target.c, signed char, s, l, &readval); > - if (readval != src) { > - printf("Error (longlongwise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > - } > - } > - } > - if (!err) > - printf("Success!\n"); > - else > - printf("Failed!\n"); > - return err; > -} > - > -int run_test(void) > -{ > - int err = 0; > - int i; > - > - srand(time(NULL)); > - > - srcrand = 0; > - err |= run_test_unsigned(); > - srcrand = 0; > - err |= run_test_signed(); > - srcrand = 1; > - err |= run_test_unsigned(); > - srcrand = ~0U; > - err |= run_test_unsigned(); > - srcrand = -1; > - err |= run_test_signed(); > - srcrand = (int)0x80000000U; > - err |= run_test_signed(); > - > - for (i = 0; i < NR_TESTS; i++) { > - srcrand = rand(); > - err |= run_test_unsigned(); > - err |= run_test_signed(); > - } > - return err; > -} > - > -int main(int argc, char **argv) > -{ > - unsigned long src; > - unsigned int shift, len; > - int ret; > - union { > - unsigned char c[8]; > - unsigned short s[4]; > - unsigned int i[2]; > - unsigned long l[2]; > - unsigned long long ll[1]; > - } target; > - unsigned long long readval; > - > - if (argc > 1) > - src = atoi(argv[1]); > - else > - src = 0x12345678; > - if (argc > 2) > - shift = atoi(argv[2]); > - else > - shift = 12; > - if (argc > 3) > - len = atoi(argv[3]); > - else > - len = 40; > - > - target.i[0] = 0xFFFFFFFF; > - target.i[1] = 0xFFFFFFFF; > - bt_bitfield_write(target.c, unsigned char, shift, len, src); > - printf("bytewise\n"); > - print_byte_array(target.c, 8); > - > - target.i[0] = 0xFFFFFFFF; > - target.i[1] = 0xFFFFFFFF; > - bt_bitfield_write(target.s, unsigned short, shift, len, src); > - printf("shortwise\n"); > - print_byte_array(target.c, 8); > - > - target.i[0] = 0xFFFFFFFF; > - target.i[1] = 0xFFFFFFFF; > - bt_bitfield_write(target.i, unsigned int, shift, len, src); > - printf("intwise\n"); > - print_byte_array(target.c, 8); > - > - target.i[0] = 0xFFFFFFFF; > - target.i[1] = 0xFFFFFFFF; > - bt_bitfield_write(target.l, unsigned long, shift, len, src); > - printf("longwise\n"); > - print_byte_array(target.c, 8); > - > - target.i[0] = 0xFFFFFFFF; > - target.i[1] = 0xFFFFFFFF; > - bt_bitfield_write(target.ll, unsigned long long, shift, len, src); > - printf("lluwise\n"); > - print_byte_array(target.c, 8); > - > - bt_bitfield_read(target.c, unsigned char, shift, len, &readval); > - printf("read: %llX\n", readval); > - > - ret = run_test(); > - > - return ret; > -} > -- > 1.8.1.1 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Thu Feb 7 17:34:09 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 7 Feb 2013 17:34:09 -0500 Subject: [lttng-dev] [PATCH babeltrace 2/2] Convert the unit tests to the TAP format In-Reply-To: <1360273253-12401-2-git-send-email-jeremie.galarneau@efficios.com> References: <20130207174526.GA6632@Krystal> <1360273253-12401-1-git-send-email-jeremie.galarneau@efficios.com> <1360273253-12401-2-git-send-email-jeremie.galarneau@efficios.com> Message-ID: <20130207223409.GB10074@Krystal> * J?r?mie Galarneau (jeremie.galarneau at efficios.com) wrote: > > Signed-off-by: J?r?mie Galarneau > --- > tests/lib/Makefile.am | 2 + > tests/lib/test-bitfield.c | 242 +++++++++++++++++++--------------------------- > tests/runall.sh | 88 +++++++---------- > 3 files changed, 139 insertions(+), 193 deletions(-) > > diff --git a/tests/lib/Makefile.am b/tests/lib/Makefile.am > index 0613beb..01831de 100644 > --- a/tests/lib/Makefile.am > +++ b/tests/lib/Makefile.am > @@ -8,6 +8,8 @@ test_seeks_LDADD = libtestcommon.a \ > $(top_builddir)/lib/libbabeltrace.la \ > $(top_builddir)/formats/ctf/libbabeltrace-ctf.la > > +test_bitfield_LDADD = libtestcommon.a > + > noinst_PROGRAMS = test-seeks test-bitfield > > test_seeks_SOURCES = test-seeks.c > diff --git a/tests/lib/test-bitfield.c b/tests/lib/test-bitfield.c > index 3bf7568..9b8e737 100644 > --- a/tests/lib/test-bitfield.c > +++ b/tests/lib/test-bitfield.c > @@ -25,6 +25,8 @@ > #include > #include > > +#include "tap.h" > + > unsigned int glob; > > /* > @@ -130,8 +132,6 @@ int run_test_unsigned(void) > unsigned int s, l; > int err = 0; > > - printf("Running unsigned test with 0x%X\n", srcrand); > - > src = srcrand; > nrbits = fls(src); > > @@ -140,58 +140,38 @@ int run_test_unsigned(void) > init_byte_array(target.c, TEST_LEN, 0xFF); > bt_bitfield_write(target.c, unsigned char, s, l, src); > bt_bitfield_read(target.c, unsigned char, s, l, &readval); > - if (readval != src) { > - printf("Error (bytewise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); we seem to be losing a lot of information with this change. Is it possible to keep this info with the transition to TAP when an error is detected ? Thanks, Mathieu > - err = 1; > - } > + err = readval != src ? 1 : err; > > init_byte_array(target.c, TEST_LEN, 0xFF); > bt_bitfield_write(target.s, unsigned short, s, l, src); > bt_bitfield_read(target.c, unsigned char, s, l, &readval); > - if (readval != src) { > - printf("Error (shortwise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > - } > + err = readval != src ? 1 : err; > > init_byte_array(target.c, TEST_LEN, 0xFF); > bt_bitfield_write(target.i, unsigned int, s, l, src); > bt_bitfield_read(target.c, unsigned char, s, l, &readval); > - if (readval != src) { > - printf("Error (intwise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > - } > + err = readval != src ? 1 : err; > > init_byte_array(target.c, TEST_LEN, 0xFF); > bt_bitfield_write(target.l, unsigned long, s, l, src); > bt_bitfield_read(target.c, unsigned char, s, l, &readval); > - if (readval != src) { > - printf("Error (longwise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > - } > + err = readval != src ? 1 : err; > > init_byte_array(target.c, TEST_LEN, 0xFF); > bt_bitfield_write(target.ll, unsigned long long, s, l, src); > bt_bitfield_read(target.c, unsigned char, s, l, &readval); > - if (readval != src) { > - printf("Error (longlongwise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > + err = readval != src ? 1 : err; > + > + if (err) { > + goto end; > } > } > } > - if (!err) > - printf("Success!\n"); > - else > - printf("Failed!\n"); > +end: > + ok(err == 0, "Writing and reading back 0x%X, unsigned", src); > + if (err) { > + printf("# Failed with start=%i and length=%i\n", s, l); > + } > return err; > } > > @@ -209,163 +189,141 @@ int run_test_signed(void) > unsigned int s, l; > int err = 0; > > - printf("Running signed test with 0x%X\n", srcrand); > - > src = srcrand; > if (src & 0x80000000U) > nrbits = fls(~src) + 1; /* Find least significant bit conveying sign */ > else > nrbits = fls(src) + 1; /* Keep sign at 0 */ > > - for (s = 0; s < 8 * TEST_LEN; s++) { > - for (l = nrbits; l < (8 * TEST_LEN) - s; l++) { > + for (s = 0; s < CHAR_BIT * TEST_LEN; s++) { > + for (l = nrbits; l < (CHAR_BIT * TEST_LEN) - s; l++) { > init_byte_array(target.c, TEST_LEN, 0x0); > bt_bitfield_write(target.c, signed char, s, l, src); > bt_bitfield_read(target.c, signed char, s, l, &readval); > - if (readval != src) { > - printf("Error (bytewise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > - } > + err = readval != src ? 1 : err; > > init_byte_array(target.c, TEST_LEN, 0x0); > bt_bitfield_write(target.s, short, s, l, src); > bt_bitfield_read(target.c, signed char, s, l, &readval); > - if (readval != src) { > - printf("Error (shortwise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > - } > + err = readval != src ? 1 : err; > > init_byte_array(target.c, TEST_LEN, 0x0); > bt_bitfield_write(target.i, int, s, l, src); > bt_bitfield_read(target.c, signed char, s, l, &readval); > - if (readval != src) { > - printf("Error (intwise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > - } > + err = readval != src ? 1 : err; > > init_byte_array(target.c, TEST_LEN, 0x0); > bt_bitfield_write(target.l, long, s, l, src); > bt_bitfield_read(target.c, signed char, s, l, &readval); > - if (readval != src) { > - printf("Error (longwise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > - } > + err = readval != src ? 1 : err; > > init_byte_array(target.c, TEST_LEN, 0x0); > bt_bitfield_write(target.ll, long long, s, l, src); > bt_bitfield_read(target.c, signed char, s, l, &readval); > - if (readval != src) { > - printf("Error (longlongwise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > + err = readval != src ? 1 : err; > + > + if (err) { > + goto end; > } > } > } > - if (!err) > - printf("Success!\n"); > - else > - printf("Failed!\n"); > +end: > + ok(err == 0, "Writing and reading back 0x%X, signed", src); > + if (err) { > + printf("#Failed with start=%i and length=%i\n", s, l); > + } > return err; > } > > -int run_test(void) > +void run_test(void) > { > - int err = 0; > int i; > + plan_tests(NR_TESTS * 2 + 6); > > srand(time(NULL)); > > srcrand = 0; > - err |= run_test_unsigned(); > + run_test_unsigned(); > srcrand = 0; > - err |= run_test_signed(); > + run_test_signed(); > + > srcrand = 1; > - err |= run_test_unsigned(); > + run_test_unsigned(); > + > srcrand = ~0U; > - err |= run_test_unsigned(); > + run_test_unsigned(); > + > srcrand = -1; > - err |= run_test_signed(); > + run_test_signed(); > + > srcrand = (int)0x80000000U; > - err |= run_test_signed(); > + run_test_signed(); > > for (i = 0; i < NR_TESTS; i++) { > srcrand = rand(); > - err |= run_test_unsigned(); > - err |= run_test_signed(); > + run_test_unsigned(); > + run_test_signed(); > } > - return err; > } > > int main(int argc, char **argv) > { > - unsigned long src; > - unsigned int shift, len; > - int ret; > - union { > - unsigned char c[8]; > - unsigned short s[4]; > - unsigned int i[2]; > - unsigned long l[2]; > - unsigned long long ll[1]; > - } target; > - unsigned long long readval; > + if (argc > 1) { > + /* Run interactive tests */ > + unsigned long src; > + unsigned int shift, len; > + union { > + unsigned char c[8]; > + unsigned short s[4]; > + unsigned int i[2]; > + unsigned long l[2]; > + unsigned long long ll[1]; > + } target; > + unsigned long long readval; > > - if (argc > 1) > src = atoi(argv[1]); > - else > - src = 0x12345678; > - if (argc > 2) > - shift = atoi(argv[2]); > - else > - shift = 12; > - if (argc > 3) > - len = atoi(argv[3]); > - else > - len = 40; > - > - target.i[0] = 0xFFFFFFFF; > - target.i[1] = 0xFFFFFFFF; > - bt_bitfield_write(target.c, unsigned char, shift, len, src); > - printf("bytewise\n"); > - print_byte_array(target.c, 8); > - > - target.i[0] = 0xFFFFFFFF; > - target.i[1] = 0xFFFFFFFF; > - bt_bitfield_write(target.s, unsigned short, shift, len, src); > - printf("shortwise\n"); > - print_byte_array(target.c, 8); > - > - target.i[0] = 0xFFFFFFFF; > - target.i[1] = 0xFFFFFFFF; > - bt_bitfield_write(target.i, unsigned int, shift, len, src); > - printf("intwise\n"); > - print_byte_array(target.c, 8); > - > - target.i[0] = 0xFFFFFFFF; > - target.i[1] = 0xFFFFFFFF; > - bt_bitfield_write(target.l, unsigned long, shift, len, src); > - printf("longwise\n"); > - print_byte_array(target.c, 8); > - > - target.i[0] = 0xFFFFFFFF; > - target.i[1] = 0xFFFFFFFF; > - bt_bitfield_write(target.ll, unsigned long long, shift, len, src); > - printf("lluwise\n"); > - print_byte_array(target.c, 8); > - > - bt_bitfield_read(target.c, unsigned char, shift, len, &readval); > - printf("read: %llX\n", readval); > - > - ret = run_test(); > - > - return ret; > + if (argc > 2) > + shift = atoi(argv[2]); > + else > + shift = 12; > + if (argc > 3) > + len = atoi(argv[3]); > + else > + len = 40; > + > + init_byte_array(target.c, 8, 0xFF); > + bt_bitfield_write(target.c, unsigned char, shift, len, src); > + printf("bytewise\n"); > + print_byte_array(target.c, 8); > + > + init_byte_array(target.c, 8, 0xFF); > + bt_bitfield_write(target.s, unsigned short, shift, len, src); > + printf("shortwise\n"); > + print_byte_array(target.c, 8); > + > + init_byte_array(target.c, 8, 0xFF); > + bt_bitfield_write(target.i, unsigned int, shift, len, src); > + printf("intwise\n"); > + print_byte_array(target.c, 8); > + > + init_byte_array(target.c, 8, 0xFF); > + bt_bitfield_write(target.l, unsigned long, shift, len, src); > + printf("longwise\n"); > + print_byte_array(target.c, 8); > + > + init_byte_array(target.c, 8, 0xFF); > + bt_bitfield_write(target.ll, unsigned long long, shift, len, src); > + printf("lluwise\n"); > + print_byte_array(target.c, 8); > + > + bt_bitfield_read(target.c, unsigned char, shift, len, &readval); > + printf("read: %llX\n", readval); > + print_byte_array(target.c, 8); > + > + return 0; > + } > + > + /* Run tap-formated tests */ > + run_test(); > + return exit_status(); > } > diff --git a/tests/runall.sh b/tests/runall.sh > index 9e0bdca..c10e88a 100755 > --- a/tests/runall.sh > +++ b/tests/runall.sh > @@ -5,44 +5,20 @@ DIR=$(readlink -f ${TESTDIR}) > BABELTRACE_BIN=${DIR}/../converter/babeltrace > CTF_TRACES=${DIR}/ctf-traces > > -function print_ok () > -{ > - # Check if we are a terminal > - if [ -t 1 ]; then > - echo -e "\e[1;32mOK\e[0m" > - else > - echo -e "OK" > - fi > -} > - > -function print_fail () > -{ > - # Check if we are a terminal > - if [ -t 1 ]; then > - echo -e "\e[1;31mFAIL\e[0m" > - else > - echo -e "FAIL" > - fi > -} > - > -function test_check () > +function test_check_success () > { > if [ $? -ne 0 ] ; then > - print_fail > return 1 > else > - print_ok > return 0 > fi > } > > function test_check_fail () > { > - if [ $? -ne 1 ] ; then > - print_fail > + if [ $? -eq 0 ] ; then > return 1 > else > - print_ok > return 0 > fi > } > @@ -53,38 +29,48 @@ function run_babeltrace () > return $? > } > > -#run babeltrace expects success > -echo -e "Running babeltrace without argument..." > -run_babeltrace > -test_check > -if [ $? -ne 0 ]; then > - exit 1 > -fi > - > -for a in ${CTF_TRACES}/succeed/*; do > - echo -e "Running babeltrace for trace ${a}..." > - run_babeltrace ${a} > - test_check > - if [ $? -ne 0 ]; then > +function print_test_result () > +{ > + if [ $# -ne 3 ] ; then > + echo "Invalid arguments provided" > exit 1 > fi > -done > > -#run babeltrace expects failure > -echo -e "Running babeltrace with bogus argument..." > + if [ ${2} -eq 0 ] ; then > + echo -n "ok" > + else > + echo -n "not ok" > + fi > + echo -e " "${1}" - "${3} > +} > + > +successTraces=(${CTF_TRACES}/succeed/*) > +failTraces=(${CTF_TRACES}/fail/*) > +testCount=$((2 + ${#successTraces[@]} + ${#failTraces[@]})) > + > +currentTestIndex=1 > +echo -e 1..${testCount} > + > +#run babeltrace, expects success > +run_babeltrace > +test_check_success > +print_test_result $((currentTestIndex++)) $? "Running babeltrace without arguments" > + > +#run babeltrace with a bogus argument, expects failure > run_babeltrace --bogusarg > test_check_fail > -if [ $? -ne 0 ]; then > - exit 1 > -fi > +print_test_result $((currentTestIndex++)) $? "Running babeltrace with a bogus argument" > + > +for tracePath in ${successTraces[@]}; do > + run_babeltrace ${tracePath} > + test_check_success > + print_test_result $((currentTestIndex++)) $? "Running babeltrace with trace ${tracePath}" > +done > > -for a in ${CTF_TRACES}/fail/*; do > - echo -e "Running babeltrace for trace ${a}..." > - run_babeltrace ${a} > +for tracePath in ${failTraces[@]}; do > + run_babeltrace ${tracePath} > test_check_fail > - if [ $? -ne 0 ]; then > - exit 1 > - fi > + print_test_result $((currentTestIndex++)) $? "Running babeltrace with trace ${tracePath}" > done > > exit 0 > -- > 1.8.1.1 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From jeremie.galarneau at efficios.com Thu Feb 7 17:56:15 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Thu, 7 Feb 2013 17:56:15 -0500 Subject: [lttng-dev] [PATCH babeltrace 2/2] Convert the unit tests to the TAP format In-Reply-To: <20130207223409.GB10074@Krystal> References: <20130207174526.GA6632@Krystal> <1360273253-12401-1-git-send-email-jeremie.galarneau@efficios.com> <1360273253-12401-2-git-send-email-jeremie.galarneau@efficios.com> <20130207223409.GB10074@Krystal> Message-ID: Yes, I'll change the test to print more diagnostic info when an error occurs. On Thu, Feb 7, 2013 at 5:34 PM, Mathieu Desnoyers wrote: > * J?r?mie Galarneau (jeremie.galarneau at efficios.com) wrote: >> >> Signed-off-by: J?r?mie Galarneau >> --- >> tests/lib/Makefile.am | 2 + >> tests/lib/test-bitfield.c | 242 +++++++++++++++++++--------------------------- >> tests/runall.sh | 88 +++++++---------- >> 3 files changed, 139 insertions(+), 193 deletions(-) >> >> diff --git a/tests/lib/Makefile.am b/tests/lib/Makefile.am >> index 0613beb..01831de 100644 >> --- a/tests/lib/Makefile.am >> +++ b/tests/lib/Makefile.am >> @@ -8,6 +8,8 @@ test_seeks_LDADD = libtestcommon.a \ >> $(top_builddir)/lib/libbabeltrace.la \ >> $(top_builddir)/formats/ctf/libbabeltrace-ctf.la >> >> +test_bitfield_LDADD = libtestcommon.a >> + >> noinst_PROGRAMS = test-seeks test-bitfield >> >> test_seeks_SOURCES = test-seeks.c >> diff --git a/tests/lib/test-bitfield.c b/tests/lib/test-bitfield.c >> index 3bf7568..9b8e737 100644 >> --- a/tests/lib/test-bitfield.c >> +++ b/tests/lib/test-bitfield.c >> @@ -25,6 +25,8 @@ >> #include >> #include >> >> +#include "tap.h" >> + >> unsigned int glob; >> >> /* >> @@ -130,8 +132,6 @@ int run_test_unsigned(void) >> unsigned int s, l; >> int err = 0; >> >> - printf("Running unsigned test with 0x%X\n", srcrand); >> - >> src = srcrand; >> nrbits = fls(src); >> >> @@ -140,58 +140,38 @@ int run_test_unsigned(void) >> init_byte_array(target.c, TEST_LEN, 0xFF); >> bt_bitfield_write(target.c, unsigned char, s, l, src); >> bt_bitfield_read(target.c, unsigned char, s, l, &readval); >> - if (readval != src) { >> - printf("Error (bytewise) src %X read %llX shift %d len %d\n", >> - src, readval, s, l); >> - print_byte_array(target.c, TEST_LEN); > > we seem to be losing a lot of information with this change. Is it > possible to keep this info with the transition to TAP when an error is > detected ? > > Thanks, > > Mathieu > >> - err = 1; >> - } >> + err = readval != src ? 1 : err; >> >> init_byte_array(target.c, TEST_LEN, 0xFF); >> bt_bitfield_write(target.s, unsigned short, s, l, src); >> bt_bitfield_read(target.c, unsigned char, s, l, &readval); >> - if (readval != src) { >> - printf("Error (shortwise) src %X read %llX shift %d len %d\n", >> - src, readval, s, l); >> - print_byte_array(target.c, TEST_LEN); >> - err = 1; >> - } >> + err = readval != src ? 1 : err; >> >> init_byte_array(target.c, TEST_LEN, 0xFF); >> bt_bitfield_write(target.i, unsigned int, s, l, src); >> bt_bitfield_read(target.c, unsigned char, s, l, &readval); >> - if (readval != src) { >> - printf("Error (intwise) src %X read %llX shift %d len %d\n", >> - src, readval, s, l); >> - print_byte_array(target.c, TEST_LEN); >> - err = 1; >> - } >> + err = readval != src ? 1 : err; >> >> init_byte_array(target.c, TEST_LEN, 0xFF); >> bt_bitfield_write(target.l, unsigned long, s, l, src); >> bt_bitfield_read(target.c, unsigned char, s, l, &readval); >> - if (readval != src) { >> - printf("Error (longwise) src %X read %llX shift %d len %d\n", >> - src, readval, s, l); >> - print_byte_array(target.c, TEST_LEN); >> - err = 1; >> - } >> + err = readval != src ? 1 : err; >> >> init_byte_array(target.c, TEST_LEN, 0xFF); >> bt_bitfield_write(target.ll, unsigned long long, s, l, src); >> bt_bitfield_read(target.c, unsigned char, s, l, &readval); >> - if (readval != src) { >> - printf("Error (longlongwise) src %X read %llX shift %d len %d\n", >> - src, readval, s, l); >> - print_byte_array(target.c, TEST_LEN); >> - err = 1; >> + err = readval != src ? 1 : err; >> + >> + if (err) { >> + goto end; >> } >> } >> } >> - if (!err) >> - printf("Success!\n"); >> - else >> - printf("Failed!\n"); >> +end: >> + ok(err == 0, "Writing and reading back 0x%X, unsigned", src); >> + if (err) { >> + printf("# Failed with start=%i and length=%i\n", s, l); >> + } >> return err; >> } >> >> @@ -209,163 +189,141 @@ int run_test_signed(void) >> unsigned int s, l; >> int err = 0; >> >> - printf("Running signed test with 0x%X\n", srcrand); >> - >> src = srcrand; >> if (src & 0x80000000U) >> nrbits = fls(~src) + 1; /* Find least significant bit conveying sign */ >> else >> nrbits = fls(src) + 1; /* Keep sign at 0 */ >> >> - for (s = 0; s < 8 * TEST_LEN; s++) { >> - for (l = nrbits; l < (8 * TEST_LEN) - s; l++) { >> + for (s = 0; s < CHAR_BIT * TEST_LEN; s++) { >> + for (l = nrbits; l < (CHAR_BIT * TEST_LEN) - s; l++) { >> init_byte_array(target.c, TEST_LEN, 0x0); >> bt_bitfield_write(target.c, signed char, s, l, src); >> bt_bitfield_read(target.c, signed char, s, l, &readval); >> - if (readval != src) { >> - printf("Error (bytewise) src %X read %llX shift %d len %d\n", >> - src, readval, s, l); >> - print_byte_array(target.c, TEST_LEN); >> - err = 1; >> - } >> + err = readval != src ? 1 : err; >> >> init_byte_array(target.c, TEST_LEN, 0x0); >> bt_bitfield_write(target.s, short, s, l, src); >> bt_bitfield_read(target.c, signed char, s, l, &readval); >> - if (readval != src) { >> - printf("Error (shortwise) src %X read %llX shift %d len %d\n", >> - src, readval, s, l); >> - print_byte_array(target.c, TEST_LEN); >> - err = 1; >> - } >> + err = readval != src ? 1 : err; >> >> init_byte_array(target.c, TEST_LEN, 0x0); >> bt_bitfield_write(target.i, int, s, l, src); >> bt_bitfield_read(target.c, signed char, s, l, &readval); >> - if (readval != src) { >> - printf("Error (intwise) src %X read %llX shift %d len %d\n", >> - src, readval, s, l); >> - print_byte_array(target.c, TEST_LEN); >> - err = 1; >> - } >> + err = readval != src ? 1 : err; >> >> init_byte_array(target.c, TEST_LEN, 0x0); >> bt_bitfield_write(target.l, long, s, l, src); >> bt_bitfield_read(target.c, signed char, s, l, &readval); >> - if (readval != src) { >> - printf("Error (longwise) src %X read %llX shift %d len %d\n", >> - src, readval, s, l); >> - print_byte_array(target.c, TEST_LEN); >> - err = 1; >> - } >> + err = readval != src ? 1 : err; >> >> init_byte_array(target.c, TEST_LEN, 0x0); >> bt_bitfield_write(target.ll, long long, s, l, src); >> bt_bitfield_read(target.c, signed char, s, l, &readval); >> - if (readval != src) { >> - printf("Error (longlongwise) src %X read %llX shift %d len %d\n", >> - src, readval, s, l); >> - print_byte_array(target.c, TEST_LEN); >> - err = 1; >> + err = readval != src ? 1 : err; >> + >> + if (err) { >> + goto end; >> } >> } >> } >> - if (!err) >> - printf("Success!\n"); >> - else >> - printf("Failed!\n"); >> +end: >> + ok(err == 0, "Writing and reading back 0x%X, signed", src); >> + if (err) { >> + printf("#Failed with start=%i and length=%i\n", s, l); >> + } >> return err; >> } >> >> -int run_test(void) >> +void run_test(void) >> { >> - int err = 0; >> int i; >> + plan_tests(NR_TESTS * 2 + 6); >> >> srand(time(NULL)); >> >> srcrand = 0; >> - err |= run_test_unsigned(); >> + run_test_unsigned(); >> srcrand = 0; >> - err |= run_test_signed(); >> + run_test_signed(); >> + >> srcrand = 1; >> - err |= run_test_unsigned(); >> + run_test_unsigned(); >> + >> srcrand = ~0U; >> - err |= run_test_unsigned(); >> + run_test_unsigned(); >> + >> srcrand = -1; >> - err |= run_test_signed(); >> + run_test_signed(); >> + >> srcrand = (int)0x80000000U; >> - err |= run_test_signed(); >> + run_test_signed(); >> >> for (i = 0; i < NR_TESTS; i++) { >> srcrand = rand(); >> - err |= run_test_unsigned(); >> - err |= run_test_signed(); >> + run_test_unsigned(); >> + run_test_signed(); >> } >> - return err; >> } >> >> int main(int argc, char **argv) >> { >> - unsigned long src; >> - unsigned int shift, len; >> - int ret; >> - union { >> - unsigned char c[8]; >> - unsigned short s[4]; >> - unsigned int i[2]; >> - unsigned long l[2]; >> - unsigned long long ll[1]; >> - } target; >> - unsigned long long readval; >> + if (argc > 1) { >> + /* Run interactive tests */ >> + unsigned long src; >> + unsigned int shift, len; >> + union { >> + unsigned char c[8]; >> + unsigned short s[4]; >> + unsigned int i[2]; >> + unsigned long l[2]; >> + unsigned long long ll[1]; >> + } target; >> + unsigned long long readval; >> >> - if (argc > 1) >> src = atoi(argv[1]); >> - else >> - src = 0x12345678; >> - if (argc > 2) >> - shift = atoi(argv[2]); >> - else >> - shift = 12; >> - if (argc > 3) >> - len = atoi(argv[3]); >> - else >> - len = 40; >> - >> - target.i[0] = 0xFFFFFFFF; >> - target.i[1] = 0xFFFFFFFF; >> - bt_bitfield_write(target.c, unsigned char, shift, len, src); >> - printf("bytewise\n"); >> - print_byte_array(target.c, 8); >> - >> - target.i[0] = 0xFFFFFFFF; >> - target.i[1] = 0xFFFFFFFF; >> - bt_bitfield_write(target.s, unsigned short, shift, len, src); >> - printf("shortwise\n"); >> - print_byte_array(target.c, 8); >> - >> - target.i[0] = 0xFFFFFFFF; >> - target.i[1] = 0xFFFFFFFF; >> - bt_bitfield_write(target.i, unsigned int, shift, len, src); >> - printf("intwise\n"); >> - print_byte_array(target.c, 8); >> - >> - target.i[0] = 0xFFFFFFFF; >> - target.i[1] = 0xFFFFFFFF; >> - bt_bitfield_write(target.l, unsigned long, shift, len, src); >> - printf("longwise\n"); >> - print_byte_array(target.c, 8); >> - >> - target.i[0] = 0xFFFFFFFF; >> - target.i[1] = 0xFFFFFFFF; >> - bt_bitfield_write(target.ll, unsigned long long, shift, len, src); >> - printf("lluwise\n"); >> - print_byte_array(target.c, 8); >> - >> - bt_bitfield_read(target.c, unsigned char, shift, len, &readval); >> - printf("read: %llX\n", readval); >> - >> - ret = run_test(); >> - >> - return ret; >> + if (argc > 2) >> + shift = atoi(argv[2]); >> + else >> + shift = 12; >> + if (argc > 3) >> + len = atoi(argv[3]); >> + else >> + len = 40; >> + >> + init_byte_array(target.c, 8, 0xFF); >> + bt_bitfield_write(target.c, unsigned char, shift, len, src); >> + printf("bytewise\n"); >> + print_byte_array(target.c, 8); >> + >> + init_byte_array(target.c, 8, 0xFF); >> + bt_bitfield_write(target.s, unsigned short, shift, len, src); >> + printf("shortwise\n"); >> + print_byte_array(target.c, 8); >> + >> + init_byte_array(target.c, 8, 0xFF); >> + bt_bitfield_write(target.i, unsigned int, shift, len, src); >> + printf("intwise\n"); >> + print_byte_array(target.c, 8); >> + >> + init_byte_array(target.c, 8, 0xFF); >> + bt_bitfield_write(target.l, unsigned long, shift, len, src); >> + printf("longwise\n"); >> + print_byte_array(target.c, 8); >> + >> + init_byte_array(target.c, 8, 0xFF); >> + bt_bitfield_write(target.ll, unsigned long long, shift, len, src); >> + printf("lluwise\n"); >> + print_byte_array(target.c, 8); >> + >> + bt_bitfield_read(target.c, unsigned char, shift, len, &readval); >> + printf("read: %llX\n", readval); >> + print_byte_array(target.c, 8); >> + >> + return 0; >> + } >> + >> + /* Run tap-formated tests */ >> + run_test(); >> + return exit_status(); >> } >> diff --git a/tests/runall.sh b/tests/runall.sh >> index 9e0bdca..c10e88a 100755 >> --- a/tests/runall.sh >> +++ b/tests/runall.sh >> @@ -5,44 +5,20 @@ DIR=$(readlink -f ${TESTDIR}) >> BABELTRACE_BIN=${DIR}/../converter/babeltrace >> CTF_TRACES=${DIR}/ctf-traces >> >> -function print_ok () >> -{ >> - # Check if we are a terminal >> - if [ -t 1 ]; then >> - echo -e "\e[1;32mOK\e[0m" >> - else >> - echo -e "OK" >> - fi >> -} >> - >> -function print_fail () >> -{ >> - # Check if we are a terminal >> - if [ -t 1 ]; then >> - echo -e "\e[1;31mFAIL\e[0m" >> - else >> - echo -e "FAIL" >> - fi >> -} >> - >> -function test_check () >> +function test_check_success () >> { >> if [ $? -ne 0 ] ; then >> - print_fail >> return 1 >> else >> - print_ok >> return 0 >> fi >> } >> >> function test_check_fail () >> { >> - if [ $? -ne 1 ] ; then >> - print_fail >> + if [ $? -eq 0 ] ; then >> return 1 >> else >> - print_ok >> return 0 >> fi >> } >> @@ -53,38 +29,48 @@ function run_babeltrace () >> return $? >> } >> >> -#run babeltrace expects success >> -echo -e "Running babeltrace without argument..." >> -run_babeltrace >> -test_check >> -if [ $? -ne 0 ]; then >> - exit 1 >> -fi >> - >> -for a in ${CTF_TRACES}/succeed/*; do >> - echo -e "Running babeltrace for trace ${a}..." >> - run_babeltrace ${a} >> - test_check >> - if [ $? -ne 0 ]; then >> +function print_test_result () >> +{ >> + if [ $# -ne 3 ] ; then >> + echo "Invalid arguments provided" >> exit 1 >> fi >> -done >> >> -#run babeltrace expects failure >> -echo -e "Running babeltrace with bogus argument..." >> + if [ ${2} -eq 0 ] ; then >> + echo -n "ok" >> + else >> + echo -n "not ok" >> + fi >> + echo -e " "${1}" - "${3} >> +} >> + >> +successTraces=(${CTF_TRACES}/succeed/*) >> +failTraces=(${CTF_TRACES}/fail/*) >> +testCount=$((2 + ${#successTraces[@]} + ${#failTraces[@]})) >> + >> +currentTestIndex=1 >> +echo -e 1..${testCount} >> + >> +#run babeltrace, expects success >> +run_babeltrace >> +test_check_success >> +print_test_result $((currentTestIndex++)) $? "Running babeltrace without arguments" >> + >> +#run babeltrace with a bogus argument, expects failure >> run_babeltrace --bogusarg >> test_check_fail >> -if [ $? -ne 0 ]; then >> - exit 1 >> -fi >> +print_test_result $((currentTestIndex++)) $? "Running babeltrace with a bogus argument" >> + >> +for tracePath in ${successTraces[@]}; do >> + run_babeltrace ${tracePath} >> + test_check_success >> + print_test_result $((currentTestIndex++)) $? "Running babeltrace with trace ${tracePath}" >> +done >> >> -for a in ${CTF_TRACES}/fail/*; do >> - echo -e "Running babeltrace for trace ${a}..." >> - run_babeltrace ${a} >> +for tracePath in ${failTraces[@]}; do >> + run_babeltrace ${tracePath} >> test_check_fail >> - if [ $? -ne 0 ]; then >> - exit 1 >> - fi >> + print_test_result $((currentTestIndex++)) $? "Running babeltrace with trace ${tracePath}" >> done >> >> exit 0 >> -- >> 1.8.1.1 >> >> >> _______________________________________________ >> lttng-dev mailing list >> lttng-dev at lists.lttng.org >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com From christian.babeux at efficios.com Thu Feb 7 22:47:04 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Thu, 7 Feb 2013 22:47:04 -0500 Subject: [lttng-dev] [PATCH lttng-tools] Fix: Conditionally disable overlap app test requiring shared libs support Message-ID: <1360295224-5970-1-git-send-email-christian.babeux@efficios.com> When building lttng-tools with shared library support explicitly disabled (e.g.: ./configure --disable-shared), libtool fail with a fatal error: Making all in demo CC tp.lo CC tp2.lo CC tp3.lo CC demo.o CCLD demo CCLD liblttng-ust-provider-ust-tests-demo.la CCLD liblttng-ust-provider-ust-tests-demo3.la libtool: link: can not build a shared library libtool: link: See the libtool documentation for more information. libtool: link: Fatal configuration error. The build should not fail because some tests require explicit shared library support, instead they should be skipped. This can be accomplished by detecting builds with no shared libs support with the NO_SHARED Automake variable. Signed-off-by: Christian Babeux --- tests/ust/overlap/demo/Makefile.am | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/ust/overlap/demo/Makefile.am b/tests/ust/overlap/demo/Makefile.am index e354636..68b6e08 100644 --- a/tests/ust/overlap/demo/Makefile.am +++ b/tests/ust/overlap/demo/Makefile.am @@ -1,5 +1,10 @@ AM_CFLAGS=-I$(srcdir) - +if NO_SHARED +# Do not build this test if shared libraries support was +# explicitly disabled. +else +# Force the shared flag on the noinst libraries since they are +# only built static by default FORCE_SHARED_LIB_OPTIONS = -module -shared -avoid-version \ -rpath $(abs_builddir) @@ -30,3 +35,4 @@ endif noinst_SCRIPTS = demo-trace EXTRA_DIST = demo-trace +endif -- 1.8.1.2 From jp_ikaheimonen at mentor.com Fri Feb 8 04:25:31 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Fri, 8 Feb 2013 09:25:31 +0000 Subject: [lttng-dev] How to disable an event that's been enabled by a wildcard selection or -a? Message-ID: <009B25148989C6458484484699278506985C0CFA@EU-MBX-01.mgc.mentorg.com> Consider the following scenario. I want to write a script that traces all UST tracepoints of a given application. I have no idea what the names of these tracepoints are. Also, I know that the application uses a library that contains some tracepoints I am not interested about. Now I want to trace all UST tracepoints except the ones I already know about. Is this possible with the lttng commands? If I enable all tracepoints with "lttng enable-event -u -a" I get all events, even those I do not want. I've tried using "lttng disable-event", and "lttng enable-event" with a filter, but I cannot seem to be able to get rid of the specific events. Thank you, JP Ikaheimonen Mentor Graphics Embedded Systems Division Nucleus(r) | Linux(r) | Android(tm) | Services | UI | Multi-OS Android is a trademark of Google Inc. Use of this trademark is subject to Google Permissions. Linux is the registered trademark of Linus Torvalds in the U.S. and other countries. From jeremie.galarneau at efficios.com Fri Feb 8 16:42:06 2013 From: jeremie.galarneau at efficios.com (=?UTF-8?q?J=C3=A9r=C3=A9mie=20Galarneau?=) Date: Fri, 8 Feb 2013 16:42:06 -0500 Subject: [lttng-dev] [PATCH babeltrace] Convert the unit tests to the TAP format In-Reply-To: <20130207223409.GB10074@Krystal> References: <20130207223409.GB10074@Krystal> Message-ID: <1360359726-13135-1-git-send-email-jeremie.galarneau@efficios.com> Signed-off-by: J?r?mie Galarneau --- tests/lib/Makefile.am | 2 + tests/lib/test-bitfield.c | 266 ++++++++++++++++++++++------------------------ tests/runall.sh | 88 +++++++-------- 3 files changed, 165 insertions(+), 191 deletions(-) diff --git a/tests/lib/Makefile.am b/tests/lib/Makefile.am index 0613beb..01831de 100644 --- a/tests/lib/Makefile.am +++ b/tests/lib/Makefile.am @@ -8,6 +8,8 @@ test_seeks_LDADD = libtestcommon.a \ $(top_builddir)/lib/libbabeltrace.la \ $(top_builddir)/formats/ctf/libbabeltrace-ctf.la +test_bitfield_LDADD = libtestcommon.a + noinst_PROGRAMS = test-seeks test-bitfield test_seeks_SOURCES = test-seeks.c diff --git a/tests/lib/test-bitfield.c b/tests/lib/test-bitfield.c index 3bf7568..5d4ecf6 100644 --- a/tests/lib/test-bitfield.c +++ b/tests/lib/test-bitfield.c @@ -25,6 +25,8 @@ #include #include +#include "tap.h" + unsigned int glob; /* @@ -39,6 +41,10 @@ void fct(void) /* Test array size, in bytes */ #define TEST_LEN 128 #define NR_TESTS 10 +#define SIGNED_TEST_DESC_FMT_STR "Writing and reading back 0x%X, signed" +#define UNSIGNED_TEST_DESC_FMT_STR "Writing and reading back 0x%X, unsigned" +#define DIAG_FMT_STR "Failed reading value written \"%s\"-wise, with start=%i" \ + " and length=%i. Read %llX" unsigned int srcrand; @@ -116,7 +122,19 @@ do { \ (c)[i] = (val); \ } while (0) -int run_test_unsigned(void) +#define check_result(ref, val, buffer, typename, start, len, \ + desc_fmt_str) \ + ({ \ + if (val != ref) { \ + fail(desc_fmt_str, ref); \ + diag(DIAG_FMT_STR, #typename, start, len, val); \ + printf("# "); \ + print_byte_array(buffer, TEST_LEN); \ + } \ + val != ref; \ +}) + +void run_test_unsigned(void) { unsigned int src, nrbits; union { @@ -128,9 +146,6 @@ int run_test_unsigned(void) } target; unsigned long long readval; unsigned int s, l; - int err = 0; - - printf("Running unsigned test with 0x%X\n", srcrand); src = srcrand; nrbits = fls(src); @@ -140,62 +155,49 @@ int run_test_unsigned(void) init_byte_array(target.c, TEST_LEN, 0xFF); bt_bitfield_write(target.c, unsigned char, s, l, src); bt_bitfield_read(target.c, unsigned char, s, l, &readval); - if (readval != src) { - printf("Error (bytewise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; + if (check_result(src, readval, target.c, unsigned char, + s, l, UNSIGNED_TEST_DESC_FMT_STR)) { + return; } init_byte_array(target.c, TEST_LEN, 0xFF); bt_bitfield_write(target.s, unsigned short, s, l, src); bt_bitfield_read(target.c, unsigned char, s, l, &readval); - if (readval != src) { - printf("Error (shortwise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; + if (check_result(src, readval, target.c, unsigned short, + s, l, UNSIGNED_TEST_DESC_FMT_STR)) { + return; } init_byte_array(target.c, TEST_LEN, 0xFF); bt_bitfield_write(target.i, unsigned int, s, l, src); bt_bitfield_read(target.c, unsigned char, s, l, &readval); - if (readval != src) { - printf("Error (intwise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; + if (check_result(src, readval, target.c, unsigned int, + s, l, UNSIGNED_TEST_DESC_FMT_STR)) { + return; } init_byte_array(target.c, TEST_LEN, 0xFF); bt_bitfield_write(target.l, unsigned long, s, l, src); bt_bitfield_read(target.c, unsigned char, s, l, &readval); - if (readval != src) { - printf("Error (longwise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; + if (check_result(src, readval, target.c, unsigned long, + s, l, UNSIGNED_TEST_DESC_FMT_STR)) { + return; } init_byte_array(target.c, TEST_LEN, 0xFF); bt_bitfield_write(target.ll, unsigned long long, s, l, src); bt_bitfield_read(target.c, unsigned char, s, l, &readval); - if (readval != src) { - printf("Error (longlongwise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; + if (check_result(src, readval, target.c, unsigned long long, + s, l, UNSIGNED_TEST_DESC_FMT_STR)) { + return; } } } - if (!err) - printf("Success!\n"); - else - printf("Failed!\n"); - return err; + + pass(UNSIGNED_TEST_DESC_FMT_STR, src); } -int run_test_signed(void) +void run_test_signed(void) { int src, nrbits; union { @@ -207,9 +209,6 @@ int run_test_signed(void) } target; long long readval; unsigned int s, l; - int err = 0; - - printf("Running signed test with 0x%X\n", srcrand); src = srcrand; if (src & 0x80000000U) @@ -217,155 +216,142 @@ int run_test_signed(void) else nrbits = fls(src) + 1; /* Keep sign at 0 */ - for (s = 0; s < 8 * TEST_LEN; s++) { - for (l = nrbits; l < (8 * TEST_LEN) - s; l++) { + for (s = 0; s < CHAR_BIT * TEST_LEN; s++) { + for (l = nrbits; l < (CHAR_BIT * TEST_LEN) - s; l++) { init_byte_array(target.c, TEST_LEN, 0x0); bt_bitfield_write(target.c, signed char, s, l, src); bt_bitfield_read(target.c, signed char, s, l, &readval); - if (readval != src) { - printf("Error (bytewise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; + if (check_result(src, readval, target.c, signed char, + s, l, SIGNED_TEST_DESC_FMT_STR)) { + return; } init_byte_array(target.c, TEST_LEN, 0x0); bt_bitfield_write(target.s, short, s, l, src); bt_bitfield_read(target.c, signed char, s, l, &readval); - if (readval != src) { - printf("Error (shortwise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; + if (check_result(src, readval, target.c, short, + s, l, SIGNED_TEST_DESC_FMT_STR)) { + return; } init_byte_array(target.c, TEST_LEN, 0x0); bt_bitfield_write(target.i, int, s, l, src); bt_bitfield_read(target.c, signed char, s, l, &readval); - if (readval != src) { - printf("Error (intwise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; + if (check_result(src, readval, target.c, int, + s, l, SIGNED_TEST_DESC_FMT_STR)) { + return; } init_byte_array(target.c, TEST_LEN, 0x0); bt_bitfield_write(target.l, long, s, l, src); bt_bitfield_read(target.c, signed char, s, l, &readval); - if (readval != src) { - printf("Error (longwise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; + if (check_result(src, readval, target.c, long, + s, l, SIGNED_TEST_DESC_FMT_STR)) { + return; } init_byte_array(target.c, TEST_LEN, 0x0); bt_bitfield_write(target.ll, long long, s, l, src); bt_bitfield_read(target.c, signed char, s, l, &readval); - if (readval != src) { - printf("Error (longlongwise) src %X read %llX shift %d len %d\n", - src, readval, s, l); - print_byte_array(target.c, TEST_LEN); - err = 1; + if (check_result(src, readval, target.c, long long, + s, l, SIGNED_TEST_DESC_FMT_STR)) { + return; } } } - if (!err) - printf("Success!\n"); - else - printf("Failed!\n"); - return err; + + pass(SIGNED_TEST_DESC_FMT_STR, src); } -int run_test(void) +void run_test(void) { - int err = 0; int i; + plan_tests(NR_TESTS * 2 + 6); srand(time(NULL)); srcrand = 0; - err |= run_test_unsigned(); + run_test_unsigned(); srcrand = 0; - err |= run_test_signed(); + run_test_signed(); + srcrand = 1; - err |= run_test_unsigned(); + run_test_unsigned(); + srcrand = ~0U; - err |= run_test_unsigned(); + run_test_unsigned(); + srcrand = -1; - err |= run_test_signed(); + run_test_signed(); + srcrand = (int)0x80000000U; - err |= run_test_signed(); + run_test_signed(); for (i = 0; i < NR_TESTS; i++) { srcrand = rand(); - err |= run_test_unsigned(); - err |= run_test_signed(); + run_test_unsigned(); + run_test_signed(); } - return err; } int main(int argc, char **argv) { - unsigned long src; - unsigned int shift, len; - int ret; - union { - unsigned char c[8]; - unsigned short s[4]; - unsigned int i[2]; - unsigned long l[2]; - unsigned long long ll[1]; - } target; - unsigned long long readval; + if (argc > 1) { + /* Run interactive tests */ + unsigned long src; + unsigned int shift, len; + union { + unsigned char c[8]; + unsigned short s[4]; + unsigned int i[2]; + unsigned long l[2]; + unsigned long long ll[1]; + } target; + unsigned long long readval; - if (argc > 1) src = atoi(argv[1]); - else - src = 0x12345678; - if (argc > 2) - shift = atoi(argv[2]); - else - shift = 12; - if (argc > 3) - len = atoi(argv[3]); - else - len = 40; - - target.i[0] = 0xFFFFFFFF; - target.i[1] = 0xFFFFFFFF; - bt_bitfield_write(target.c, unsigned char, shift, len, src); - printf("bytewise\n"); - print_byte_array(target.c, 8); - - target.i[0] = 0xFFFFFFFF; - target.i[1] = 0xFFFFFFFF; - bt_bitfield_write(target.s, unsigned short, shift, len, src); - printf("shortwise\n"); - print_byte_array(target.c, 8); - - target.i[0] = 0xFFFFFFFF; - target.i[1] = 0xFFFFFFFF; - bt_bitfield_write(target.i, unsigned int, shift, len, src); - printf("intwise\n"); - print_byte_array(target.c, 8); - - target.i[0] = 0xFFFFFFFF; - target.i[1] = 0xFFFFFFFF; - bt_bitfield_write(target.l, unsigned long, shift, len, src); - printf("longwise\n"); - print_byte_array(target.c, 8); - - target.i[0] = 0xFFFFFFFF; - target.i[1] = 0xFFFFFFFF; - bt_bitfield_write(target.ll, unsigned long long, shift, len, src); - printf("lluwise\n"); - print_byte_array(target.c, 8); - - bt_bitfield_read(target.c, unsigned char, shift, len, &readval); - printf("read: %llX\n", readval); - - ret = run_test(); - - return ret; + if (argc > 2) + shift = atoi(argv[2]); + else + shift = 12; + if (argc > 3) + len = atoi(argv[3]); + else + len = 40; + + init_byte_array(target.c, 8, 0xFF); + bt_bitfield_write(target.c, unsigned char, shift, len, src); + printf("bytewise\n"); + print_byte_array(target.c, 8); + + init_byte_array(target.c, 8, 0xFF); + bt_bitfield_write(target.s, unsigned short, shift, len, src); + printf("shortwise\n"); + print_byte_array(target.c, 8); + + init_byte_array(target.c, 8, 0xFF); + bt_bitfield_write(target.i, unsigned int, shift, len, src); + printf("intwise\n"); + print_byte_array(target.c, 8); + + init_byte_array(target.c, 8, 0xFF); + bt_bitfield_write(target.l, unsigned long, shift, len, src); + printf("longwise\n"); + print_byte_array(target.c, 8); + + init_byte_array(target.c, 8, 0xFF); + bt_bitfield_write(target.ll, unsigned long long, shift, len, src); + printf("lluwise\n"); + print_byte_array(target.c, 8); + + bt_bitfield_read(target.c, unsigned char, shift, len, &readval); + printf("read: %llX\n", readval); + print_byte_array(target.c, 8); + + return 0; + } + + /* Run tap-formated tests */ + run_test(); + return exit_status(); } diff --git a/tests/runall.sh b/tests/runall.sh index 9e0bdca..c10e88a 100755 --- a/tests/runall.sh +++ b/tests/runall.sh @@ -5,44 +5,20 @@ DIR=$(readlink -f ${TESTDIR}) BABELTRACE_BIN=${DIR}/../converter/babeltrace CTF_TRACES=${DIR}/ctf-traces -function print_ok () -{ - # Check if we are a terminal - if [ -t 1 ]; then - echo -e "\e[1;32mOK\e[0m" - else - echo -e "OK" - fi -} - -function print_fail () -{ - # Check if we are a terminal - if [ -t 1 ]; then - echo -e "\e[1;31mFAIL\e[0m" - else - echo -e "FAIL" - fi -} - -function test_check () +function test_check_success () { if [ $? -ne 0 ] ; then - print_fail return 1 else - print_ok return 0 fi } function test_check_fail () { - if [ $? -ne 1 ] ; then - print_fail + if [ $? -eq 0 ] ; then return 1 else - print_ok return 0 fi } @@ -53,38 +29,48 @@ function run_babeltrace () return $? } -#run babeltrace expects success -echo -e "Running babeltrace without argument..." -run_babeltrace -test_check -if [ $? -ne 0 ]; then - exit 1 -fi - -for a in ${CTF_TRACES}/succeed/*; do - echo -e "Running babeltrace for trace ${a}..." - run_babeltrace ${a} - test_check - if [ $? -ne 0 ]; then +function print_test_result () +{ + if [ $# -ne 3 ] ; then + echo "Invalid arguments provided" exit 1 fi -done -#run babeltrace expects failure -echo -e "Running babeltrace with bogus argument..." + if [ ${2} -eq 0 ] ; then + echo -n "ok" + else + echo -n "not ok" + fi + echo -e " "${1}" - "${3} +} + +successTraces=(${CTF_TRACES}/succeed/*) +failTraces=(${CTF_TRACES}/fail/*) +testCount=$((2 + ${#successTraces[@]} + ${#failTraces[@]})) + +currentTestIndex=1 +echo -e 1..${testCount} + +#run babeltrace, expects success +run_babeltrace +test_check_success +print_test_result $((currentTestIndex++)) $? "Running babeltrace without arguments" + +#run babeltrace with a bogus argument, expects failure run_babeltrace --bogusarg test_check_fail -if [ $? -ne 0 ]; then - exit 1 -fi +print_test_result $((currentTestIndex++)) $? "Running babeltrace with a bogus argument" + +for tracePath in ${successTraces[@]}; do + run_babeltrace ${tracePath} + test_check_success + print_test_result $((currentTestIndex++)) $? "Running babeltrace with trace ${tracePath}" +done -for a in ${CTF_TRACES}/fail/*; do - echo -e "Running babeltrace for trace ${a}..." - run_babeltrace ${a} +for tracePath in ${failTraces[@]}; do + run_babeltrace ${tracePath} test_check_fail - if [ $? -ne 0 ]; then - exit 1 - fi + print_test_result $((currentTestIndex++)) $? "Running babeltrace with trace ${tracePath}" done exit 0 -- 1.8.1.1 From Daniel.Thibault at drdc-rddc.gc.ca Fri Feb 8 17:02:05 2013 From: Daniel.Thibault at drdc-rddc.gc.ca (Thibault, Daniel) Date: Fri, 8 Feb 2013 22:02:05 +0000 Subject: [lttng-dev] lttng, lttng-sessiond and the tracing group Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD015C09@VAL-E-02.valcartier.drdc-rddc.gc.ca> -----Message d'origine----- Message: 3 Date: Wed, 6 Feb 2013 18:27:24 +0000 Subject: Re: [lttng-dev] lttng, lttng-sessiond and the tracing group > This may very well be an "Ubuntism". All flavours of Ubuntu use a locked > root and force all users to systematically use sudo; the su command won't > go anywhere because there is no root password. [...] The short and sweet > of it is that (nearly) all super-user operations under Ubuntu will be conducted > by a user (with sudo privileges), not by the root account. Hence the > shenanigans I ran into. It sounds like LTTng will have to adjust the way it > allocates the root .lttngrc path under Ubuntu systems, so that it uses > /root/.lttngrc instead of ~/.lttngrc ------------------------------ Follow up: Turns out the collision between the root and local daemon copies of .lttngrc can be avoided by prefixing the lttng commands with 'sudo -H' for a default Ubuntu configuration. Other sudo configurations may be susceptible to this problem as well, because the value of the HOME environment variable when invoking sudo is decided by the sudo security policy. The problem is that sysadmins can set the root HOME to an arbitrary value for whatever reason, so lttng-sessiond should not force its HOME to 'root': that would be bad form. Instead, since the daemons are communicating with each other, there could be a bit of negotiation. In a nutshell, the root daemon would veto the launch of a user lttng-sessiond if the latter's HOME matched its own. Similarly, if the root lttng-sessiond, upon launching, discovered a user lttng-sessiond with a coinciding HOME, it could either refuse to launch itself or pre-empt the user lttng-sessiond (i.e., shut it down). Either way the user(s) would get an appropriate error message. The case where multiple users are assigned a single HOME by the sysadmin would be handled similarly. On the other hand, maybe a simpler solution would be to have the .lttngrc file's name be suffixed to avoid any collisions. The root daemon's .lttngrc would become .lttngrc-root, etc. I don't think there would be a need to decorate the 'lttng-traces' folder's name, since the contained traces are already "collision-proofed" by their timestamp suffixes. Does this make sense? Daniel U. Thibault R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) / Defence R&D Canada - Valcartier (DRDC Valcartier) Cyber s?curit? pour les missions essentielles (CME) / Mission Critical Cyber Security (MCCS) Protection des syst?mes et contremesures (PSC) / Systems Protection & Countermeasures (SPC) 2459 route de la Bravoure Qu?bec, QC G3J 1X5 CANADA Vox : (418) 844-4000 x4245 Fax : (418) 844-4538 NAC : 918V QSDJ Gouvernement du Canada / Government of Canada From simon.marchi at polymtl.ca Mon Feb 11 19:04:11 2013 From: simon.marchi at polymtl.ca (Simon Marchi) Date: Mon, 11 Feb 2013 19:04:11 -0500 Subject: [lttng-dev] [PATCH urcu] Fix configure checks for Tile Message-ID: <1360627451-11698-1-git-send-email-simon.marchi@polymtl.ca> The previous method of checking whether the architecture is TileGx or not was buggy. urcu/arch/tile.h included urcu/arch/gcc.h, which was not installed on the system, causing a configure error. I am not sure why it worked when I tested commit 1000f1f4204e5fbb337f4ea911f1e29f67df79aa, maybe some previous partial install or something. The check is now done earlier, during the configure step and should not cause any trouble. Signed-off-by: Simon Marchi --- configure.ac | 17 ++++++++++++++++- urcu/arch/tile.h | 30 ------------------------------ urcu/uatomic/tile.h | 28 ---------------------------- 3 files changed, 16 insertions(+), 59 deletions(-) delete mode 100644 urcu/arch/tile.h delete mode 100644 urcu/uatomic/tile.h diff --git a/configure.ac b/configure.ac index d064a13..7a315e8 100644 --- a/configure.ac +++ b/configure.ac @@ -77,7 +77,7 @@ AS_CASE([$host_cpu], [ia64], [ARCHTYPE="gcc"], [arm*], [ARCHTYPE="arm"], [mips*], [ARCHTYPE="mips"], - [tile*], [ARCHTYPE="tile"], + [tile*], [ARCHTYPE="gcc"], [ARCHTYPE="unknown"] ) @@ -113,6 +113,21 @@ AS_IF([test "x$ARCHTYPE" = "xarm"],[ ]) ]) +# Tile-specific checks +AS_IF([echo "$host_cpu" | grep "^tile"],[ + AC_MSG_CHECKING([for Tile architecture type]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #ifndef __tilegx__ + #error + #endif + ]]) + ],[ + AC_MSG_RESULT([ok]) + ],[ + AC_MSG_FAILURE([URCU has only been tested on the TileGx architecture. For other Tile* architectures, please run the tests first and report the results to the maintainer so that proper support can be added.]) + ]) +]) + # x86-specific checks AS_IF([test "x$ARCHTYPE" = "xx86"],[ AC_MSG_CHECKING([if architecture really supports the mfence instruction]) diff --git a/urcu/arch/tile.h b/urcu/arch/tile.h deleted file mode 100644 index 8ef35da..0000000 --- a/urcu/arch/tile.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef _URCU_ARCH_TILE_H -#define _URCU_ARCH_TILE_H - -/* - * arch_tile.h: trivial definitions for the Tile architecture - * - * Copyright (c) 2013 Simon Marchi - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifdef __tilegx__ -#include -#else -#error "URCU has only been tested on the TileGx architecture. For other Tile* architectures, please run the tests first and report the results to the maintainer so that proper support can be added." -#endif - -#endif /* _URCU_ARCH_TILE_H */ diff --git a/urcu/uatomic/tile.h b/urcu/uatomic/tile.h deleted file mode 100644 index 40eafd1..0000000 --- a/urcu/uatomic/tile.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef _URCU_ARCH_UATOMIC_TILE_H -#define _URCU_ARCH_UATOMIC_TILE_H - -/* - * Copyright (c) 2013 Simon Marchi - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifdef __tilegx__ -#include -#else -#error "URCU has only been tested on the TileGx architecture. For other Tile* architectures, please run the tests first and report the results to the maintainer so that proper support can be added." -#endif - -#endif /* _URCU_ARCH_UATOMIC_TILE_H */ -- 1.7.1 From mathieu.desnoyers at efficios.com Mon Feb 11 19:12:09 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Mon, 11 Feb 2013 19:12:09 -0500 Subject: [lttng-dev] [PATCH urcu] Fix configure checks for Tile In-Reply-To: <1360627451-11698-1-git-send-email-simon.marchi@polymtl.ca> References: <1360627451-11698-1-git-send-email-simon.marchi@polymtl.ca> Message-ID: <20130212001209.GA901@Krystal> * Simon Marchi (simon.marchi at polymtl.ca) wrote: > The previous method of checking whether the architecture is TileGx or > not was buggy. urcu/arch/tile.h included urcu/arch/gcc.h, which was not > installed on the system, causing a configure error. I am not sure why it > worked when I tested commit 1000f1f4204e5fbb337f4ea911f1e29f67df79aa, > maybe some previous partial install or something. > > The check is now done earlier, during the configure step and should not > cause any trouble. merged, thanks! Mathieu > > Signed-off-by: Simon Marchi > --- > configure.ac | 17 ++++++++++++++++- > urcu/arch/tile.h | 30 ------------------------------ > urcu/uatomic/tile.h | 28 ---------------------------- > 3 files changed, 16 insertions(+), 59 deletions(-) > delete mode 100644 urcu/arch/tile.h > delete mode 100644 urcu/uatomic/tile.h > > diff --git a/configure.ac b/configure.ac > index d064a13..7a315e8 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -77,7 +77,7 @@ AS_CASE([$host_cpu], > [ia64], [ARCHTYPE="gcc"], > [arm*], [ARCHTYPE="arm"], > [mips*], [ARCHTYPE="mips"], > - [tile*], [ARCHTYPE="tile"], > + [tile*], [ARCHTYPE="gcc"], > [ARCHTYPE="unknown"] > ) > > @@ -113,6 +113,21 @@ AS_IF([test "x$ARCHTYPE" = "xarm"],[ > ]) > ]) > > +# Tile-specific checks > +AS_IF([echo "$host_cpu" | grep "^tile"],[ > + AC_MSG_CHECKING([for Tile architecture type]) > + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ > + #ifndef __tilegx__ > + #error > + #endif > + ]]) > + ],[ > + AC_MSG_RESULT([ok]) > + ],[ > + AC_MSG_FAILURE([URCU has only been tested on the TileGx architecture. For other Tile* architectures, please run the tests first and report the results to the maintainer so that proper support can be added.]) > + ]) > +]) > + > # x86-specific checks > AS_IF([test "x$ARCHTYPE" = "xx86"],[ > AC_MSG_CHECKING([if architecture really supports the mfence instruction]) > diff --git a/urcu/arch/tile.h b/urcu/arch/tile.h > deleted file mode 100644 > index 8ef35da..0000000 > --- a/urcu/arch/tile.h > +++ /dev/null > @@ -1,30 +0,0 @@ > -#ifndef _URCU_ARCH_TILE_H > -#define _URCU_ARCH_TILE_H > - > -/* > - * arch_tile.h: trivial definitions for the Tile architecture > - * > - * Copyright (c) 2013 Simon Marchi > - * > - * This library is free software; you can redistribute it and/or > - * modify it under the terms of the GNU Lesser General Public > - * License as published by the Free Software Foundation; either > - * version 2.1 of the License, or (at your option) any later version. > - * > - * This library is distributed in the hope that it will be useful, > - * but WITHOUT ANY WARRANTY; without even the implied warranty of > - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > - * Lesser General Public License for more details. > - * > - * You should have received a copy of the GNU Lesser General Public > - * License along with this library; if not, write to the Free Software > - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA > - */ > - > -#ifdef __tilegx__ > -#include > -#else > -#error "URCU has only been tested on the TileGx architecture. For other Tile* architectures, please run the tests first and report the results to the maintainer so that proper support can be added." > -#endif > - > -#endif /* _URCU_ARCH_TILE_H */ > diff --git a/urcu/uatomic/tile.h b/urcu/uatomic/tile.h > deleted file mode 100644 > index 40eafd1..0000000 > --- a/urcu/uatomic/tile.h > +++ /dev/null > @@ -1,28 +0,0 @@ > -#ifndef _URCU_ARCH_UATOMIC_TILE_H > -#define _URCU_ARCH_UATOMIC_TILE_H > - > -/* > - * Copyright (c) 2013 Simon Marchi > - * > - * This library is free software; you can redistribute it and/or > - * modify it under the terms of the GNU Lesser General Public > - * License as published by the Free Software Foundation; either > - * version 2.1 of the License, or (at your option) any later version. > - * > - * This library is distributed in the hope that it will be useful, > - * but WITHOUT ANY WARRANTY; without even the implied warranty of > - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > - * Lesser General Public License for more details. > - * > - * You should have received a copy of the GNU Lesser General Public > - * License along with this library; if not, write to the Free Software > - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA > - */ > - > -#ifdef __tilegx__ > -#include > -#else > -#error "URCU has only been tested on the TileGx architecture. For other Tile* architectures, please run the tests first and report the results to the maintainer so that proper support can be added." > -#endif > - > -#endif /* _URCU_ARCH_UATOMIC_TILE_H */ > -- > 1.7.1 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From simon.marchi at polymtl.ca Mon Feb 11 20:36:54 2013 From: simon.marchi at polymtl.ca (Simon Marchi) Date: Mon, 11 Feb 2013 20:36:54 -0500 Subject: [lttng-dev] Installation of LTTng on the TILEncore-Gx card (TILE-Gx processor) Message-ID: Now that the support for the TileGx architecture is integrated in the various tools of the LTTng chain, I thought I could reduce the bus factor and post the installation steps to get LTTng up and running on this platform. The steps assume that the TILERA_ROOT variable is set correctly. The version of the Tilera MDE used is 4.1.3.150969 with the TILEncore-Gx card. = urcu installation = $ git clone git://git.lttng.org/userspace-rcu.git $ ./bootstrap $ ac_cv_func_malloc_0_nonnull=yes ./configure --host=tile --prefix=$TILERA_ROOT/tile/usr/local $ make $ make install = lttng-ust installation = $ git clone git://git.lttng.org/lttng-ust.git $ ./bootstrap $ ./configure --host=tile --prefix=$TILERA_ROOT/tile/usr/local $ make $ make install = lttng-tools installation = $ git clone git://git.lttng.org/lttng-tools.git $ ./bootstrap $ ./configure --host=tile --prefix=$TILERA_ROOT/tile/usr/local --with-consumerd64-bin=/usr/local/lib/lttng/libexec/lttng-consumerd --with-consumerd64-libdir=/usr/local/lib $ make $ make install By default, /usr/local/lib is not in the dynamic linker's search path, so you should add it: $ echo "/usr/local/lib" >> $TILERA_ROOT/tile/etc/ld.so.conf.d/local.conf You should boot the card using --root so that the filesystem in $TILERA_ROOT/tile gets loaded on the card: $ tile-monitor --root Once on the card, you can set your path to include /usr/local/bin, update the linker cache and set the path of the session daemon binary: $ export PATH=$PATH:/usr/local/bin $ ldconfig $ LTTNG_SESSIOND_PATH=/usr/local/bin/lttng-sessiond Now you should be ready to go, I hope I didn't forget any step. Have fun ust-tracing ! Kernel tracing is a little bit more tricky because the kernel config shipped by Tilera does not activate tracepoints. There is also a fix needed to properly load the modules. Let's hope that these two issues will be resolved in a future version of the MDE. In the meantime, I can provide the instructions on this list or by personal email if anybody needs or wants them. Thanks, Simon From mathieu.desnoyers at efficios.com Mon Feb 11 20:52:31 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Mon, 11 Feb 2013 20:52:31 -0500 Subject: [lttng-dev] Installation of LTTng on the TILEncore-Gx card (TILE-Gx processor) In-Reply-To: References: Message-ID: <20130212015231.GA1603@Krystal> * Simon Marchi (simon.marchi at polymtl.ca) wrote: > Now that the support for the TileGx architecture is integrated in the > various tools of the LTTng chain, I thought I could reduce the bus > factor and post the installation steps to get LTTng up and running on > this platform. The steps assume that the TILERA_ROOT variable is set > correctly. The version of the Tilera MDE used is 4.1.3.150969 with the > TILEncore-Gx card. > > = urcu installation = > $ git clone git://git.lttng.org/userspace-rcu.git > $ ./bootstrap > $ ac_cv_func_malloc_0_nonnull=yes ./configure --host=tile > --prefix=$TILERA_ROOT/tile/usr/local FYI, usually long command lines need a \ when a line wrap occurs. > $ make > $ make install > > = lttng-ust installation = > $ git clone git://git.lttng.org/lttng-ust.git > $ ./bootstrap > $ ./configure --host=tile --prefix=$TILERA_ROOT/tile/usr/local > $ make > $ make install > > = lttng-tools installation = > $ git clone git://git.lttng.org/lttng-tools.git > $ ./bootstrap > $ ./configure --host=tile --prefix=$TILERA_ROOT/tile/usr/local > --with-consumerd64-bin=/usr/local/lib/lttng/libexec/lttng-consumerd > --with-consumerd64-libdir=/usr/local/lib same here. Just a nitpick in case this gets pulled into a manual or a wiki :) Thanks, Mathieu > $ make > $ make install > > > By default, /usr/local/lib is not in the dynamic linker's search path, > so you should add it: > $ echo "/usr/local/lib" >> $TILERA_ROOT/tile/etc/ld.so.conf.d/local.conf > > You should boot the card using --root so that the filesystem in > $TILERA_ROOT/tile gets loaded on the card: > $ tile-monitor --root > > Once on the card, you can set your path to include /usr/local/bin, > update the linker cache and set the path of the session daemon binary: > $ export PATH=$PATH:/usr/local/bin > $ ldconfig > $ LTTNG_SESSIOND_PATH=/usr/local/bin/lttng-sessiond > > Now you should be ready to go, I hope I didn't forget any step. Have > fun ust-tracing ! > > Kernel tracing is a little bit more tricky because the kernel config > shipped by Tilera does not activate tracepoints. There is also a fix > needed to properly load the modules. Let's hope that these two issues > will be resolved in a future version of the MDE. In the meantime, I > can provide the instructions on this list or by personal email if > anybody needs or wants them. > > Thanks, > > Simon > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From dsmith at redhat.com Tue Feb 12 14:56:10 2013 From: dsmith at redhat.com (David Smith) Date: Tue, 12 Feb 2013 13:56:10 -0600 Subject: [lttng-dev] Using lttng-ust's libringbuffer outside lttng-ust Message-ID: <511A9E5A.4010303@redhat.com> Over in systemtap land, we're working on implementing a pure userspace backend, using a project called dyninst (). As part of this work, we need to implement a data channel between systemtap and the target executable(s). Most of the data (print statement output) flows from probes run in the target back to systemtap. There is also a need for a control channel the flows from systemtap to the systemtap runtime present in the target. I'm looking into the possibility of using libringbuffer from lttng-ust, which seems like it might fit our needs. Based on my description above (feel free to ask for more detail), does using libringbuffer make sense? Assuming it does make sense, I could use some help. Is there any documentation that I've missed somewhere that describes libringbuffer in any detail? I've also looked through the test programs in 'lttng-ust/tests' hoping to find a test for just basic libringbuffer functionality (a standalone producer/consumer), without much luck. (The code in 'ust-basic-tracing' and 'ust-multi-test' probably comes the closest.) I started trying to write such a test, but then realized it made better sense to ask here first. The next question would be what is the best way of using libringbuffer outside lttng-ust. One (not great) possibility would be to just copy the code into systemtap. Of course the problem there is keeping the code up to date with changes in lttng-ust. The next possibility would be to make it a separate project (more like userspace-rcu). A bit of work would be needed here, since while libringbuffer is mostly self-contained, there is some use of code from 'lttng-ust/lttng-ust-comm' and 'lttng-ust/snprintf' from 'lttng-ust/libringbuffer'. Thanks for the help. -- David Smith dsmith at redhat.com Red Hat http://www.redhat.com 256.217.0141 (direct) 256.837.0057 (fax) From jdesfossez at efficios.com Tue Feb 12 15:35:59 2013 From: jdesfossez at efficios.com (Julien Desfossez) Date: Tue, 12 Feb 2013 15:35:59 -0500 Subject: [lttng-dev] [RFC] on-disk multiple tracefiles circular buffer Message-ID: <511AA7AF.60102@efficios.com> This RFC discusses at high level the modification to be made to limit the maximum size of tracefiles and the number of tracefiles to keep on disk. The intent is to create an "on-disk circular buffer" with multiple tracefiles, thus limiting the maximum disk usage of traces. The semantic is similar to the -C and -W flags of tcpdump. In tcpdump, -C limits the maximum file size and -W the amount of such files to keep on disk. The -W flag is not mandatory with the -C, so it is possible to have an "infinite" number of data files of a specific size which is useful for analysis afterwards. In LTTng, we have one stream (tracefile) per-channel per-CPU, so the restrictions will apply for all the streams of a channel. For example, if in a channel we want 5 tracefiles of 100MB each and we have 4 CPUs, we will have a maximum of 20 tracefiles of 100MB (and a single metadata file). Each tracefile will be readable independently or with the others (and correctly sorted) as long as the metadata file is available. This functionnality will be enabled by channel in LTTng, so the proposed approach is to add parameters to the channel creation calls (UI and API) and make the streams inherit these parameters so that the consumer and the relay will be able to handle the tracefiles accordingly. The proposed options names are : --tracefile_size --tracefile_count Or maybe add "max_" in there : max_tracefile_size, max_tracefile_count ? The tracefile_count is ignored if the tracefile_size is not specified. The tracefile will be splitted in a "infinite" number of files if tracefile_size is specified and tracefile_count is omitted. At the end of the tracefile name, we will add the number of tracefile, for example the 5th tracefile on CPU 2 of channel "channel0" will be named "channel0_2.5". When a tracefile must be reused (after we reach the tracefile_count), its content is truncated on open so the old data is no longer available even if we don't overwrite it completely. So this is the high-level breakdown of this new feature, if you have any comments, please send them asap. Thanks, Julien From mathieu.desnoyers at efficios.com Wed Feb 13 14:47:26 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Wed, 13 Feb 2013 14:47:26 -0500 Subject: [lttng-dev] [PATCH babeltrace] Convert the unit tests to the TAP format In-Reply-To: <1360359726-13135-1-git-send-email-jeremie.galarneau@efficios.com> References: <20130207223409.GB10074@Krystal> <1360359726-13135-1-git-send-email-jeremie.galarneau@efficios.com> Message-ID: <20130213194726.GA1515@Krystal> * J?r?mie Galarneau (jeremie.galarneau at efficios.com) wrote: > > Signed-off-by: J?r?mie Galarneau merged with minor style edits. Some suggestions for improvements: # TAP mode: ./test-bitfield -t 1..26 ...... # TAP mode for N random attempts: ./test-bitfield -t 100 1..1xx # Print "value", shifted from "shift" bits, in "len" bits type ./test-bitfield -p value shift len # Print help: ./test-bitfield ./test-bitfield -h (or --help) I look forward to see the patch! Thanks, Mathieu > --- > tests/lib/Makefile.am | 2 + > tests/lib/test-bitfield.c | 266 ++++++++++++++++++++++------------------------ > tests/runall.sh | 88 +++++++-------- > 3 files changed, 165 insertions(+), 191 deletions(-) > > diff --git a/tests/lib/Makefile.am b/tests/lib/Makefile.am > index 0613beb..01831de 100644 > --- a/tests/lib/Makefile.am > +++ b/tests/lib/Makefile.am > @@ -8,6 +8,8 @@ test_seeks_LDADD = libtestcommon.a \ > $(top_builddir)/lib/libbabeltrace.la \ > $(top_builddir)/formats/ctf/libbabeltrace-ctf.la > > +test_bitfield_LDADD = libtestcommon.a > + > noinst_PROGRAMS = test-seeks test-bitfield > > test_seeks_SOURCES = test-seeks.c > diff --git a/tests/lib/test-bitfield.c b/tests/lib/test-bitfield.c > index 3bf7568..5d4ecf6 100644 > --- a/tests/lib/test-bitfield.c > +++ b/tests/lib/test-bitfield.c > @@ -25,6 +25,8 @@ > #include > #include > > +#include "tap.h" > + > unsigned int glob; > > /* > @@ -39,6 +41,10 @@ void fct(void) > /* Test array size, in bytes */ > #define TEST_LEN 128 > #define NR_TESTS 10 > +#define SIGNED_TEST_DESC_FMT_STR "Writing and reading back 0x%X, signed" > +#define UNSIGNED_TEST_DESC_FMT_STR "Writing and reading back 0x%X, unsigned" > +#define DIAG_FMT_STR "Failed reading value written \"%s\"-wise, with start=%i" \ > + " and length=%i. Read %llX" > > unsigned int srcrand; > > @@ -116,7 +122,19 @@ do { \ > (c)[i] = (val); \ > } while (0) > > -int run_test_unsigned(void) > +#define check_result(ref, val, buffer, typename, start, len, \ > + desc_fmt_str) \ > + ({ \ > + if (val != ref) { \ > + fail(desc_fmt_str, ref); \ > + diag(DIAG_FMT_STR, #typename, start, len, val); \ > + printf("# "); \ > + print_byte_array(buffer, TEST_LEN); \ > + } \ > + val != ref; \ > +}) > + > +void run_test_unsigned(void) > { > unsigned int src, nrbits; > union { > @@ -128,9 +146,6 @@ int run_test_unsigned(void) > } target; > unsigned long long readval; > unsigned int s, l; > - int err = 0; > - > - printf("Running unsigned test with 0x%X\n", srcrand); > > src = srcrand; > nrbits = fls(src); > @@ -140,62 +155,49 @@ int run_test_unsigned(void) > init_byte_array(target.c, TEST_LEN, 0xFF); > bt_bitfield_write(target.c, unsigned char, s, l, src); > bt_bitfield_read(target.c, unsigned char, s, l, &readval); > - if (readval != src) { > - printf("Error (bytewise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > + if (check_result(src, readval, target.c, unsigned char, > + s, l, UNSIGNED_TEST_DESC_FMT_STR)) { > + return; > } > > init_byte_array(target.c, TEST_LEN, 0xFF); > bt_bitfield_write(target.s, unsigned short, s, l, src); > bt_bitfield_read(target.c, unsigned char, s, l, &readval); > - if (readval != src) { > - printf("Error (shortwise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > + if (check_result(src, readval, target.c, unsigned short, > + s, l, UNSIGNED_TEST_DESC_FMT_STR)) { > + return; > } > > init_byte_array(target.c, TEST_LEN, 0xFF); > bt_bitfield_write(target.i, unsigned int, s, l, src); > bt_bitfield_read(target.c, unsigned char, s, l, &readval); > - if (readval != src) { > - printf("Error (intwise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > + if (check_result(src, readval, target.c, unsigned int, > + s, l, UNSIGNED_TEST_DESC_FMT_STR)) { > + return; > } > > init_byte_array(target.c, TEST_LEN, 0xFF); > bt_bitfield_write(target.l, unsigned long, s, l, src); > bt_bitfield_read(target.c, unsigned char, s, l, &readval); > - if (readval != src) { > - printf("Error (longwise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > + if (check_result(src, readval, target.c, unsigned long, > + s, l, UNSIGNED_TEST_DESC_FMT_STR)) { > + return; > } > > init_byte_array(target.c, TEST_LEN, 0xFF); > bt_bitfield_write(target.ll, unsigned long long, s, l, src); > bt_bitfield_read(target.c, unsigned char, s, l, &readval); > - if (readval != src) { > - printf("Error (longlongwise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > + if (check_result(src, readval, target.c, unsigned long long, > + s, l, UNSIGNED_TEST_DESC_FMT_STR)) { > + return; > } > } > } > - if (!err) > - printf("Success!\n"); > - else > - printf("Failed!\n"); > - return err; > + > + pass(UNSIGNED_TEST_DESC_FMT_STR, src); > } > > -int run_test_signed(void) > +void run_test_signed(void) > { > int src, nrbits; > union { > @@ -207,9 +209,6 @@ int run_test_signed(void) > } target; > long long readval; > unsigned int s, l; > - int err = 0; > - > - printf("Running signed test with 0x%X\n", srcrand); > > src = srcrand; > if (src & 0x80000000U) > @@ -217,155 +216,142 @@ int run_test_signed(void) > else > nrbits = fls(src) + 1; /* Keep sign at 0 */ > > - for (s = 0; s < 8 * TEST_LEN; s++) { > - for (l = nrbits; l < (8 * TEST_LEN) - s; l++) { > + for (s = 0; s < CHAR_BIT * TEST_LEN; s++) { > + for (l = nrbits; l < (CHAR_BIT * TEST_LEN) - s; l++) { > init_byte_array(target.c, TEST_LEN, 0x0); > bt_bitfield_write(target.c, signed char, s, l, src); > bt_bitfield_read(target.c, signed char, s, l, &readval); > - if (readval != src) { > - printf("Error (bytewise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > + if (check_result(src, readval, target.c, signed char, > + s, l, SIGNED_TEST_DESC_FMT_STR)) { > + return; > } > > init_byte_array(target.c, TEST_LEN, 0x0); > bt_bitfield_write(target.s, short, s, l, src); > bt_bitfield_read(target.c, signed char, s, l, &readval); > - if (readval != src) { > - printf("Error (shortwise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > + if (check_result(src, readval, target.c, short, > + s, l, SIGNED_TEST_DESC_FMT_STR)) { > + return; > } > > init_byte_array(target.c, TEST_LEN, 0x0); > bt_bitfield_write(target.i, int, s, l, src); > bt_bitfield_read(target.c, signed char, s, l, &readval); > - if (readval != src) { > - printf("Error (intwise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > + if (check_result(src, readval, target.c, int, > + s, l, SIGNED_TEST_DESC_FMT_STR)) { > + return; > } > > init_byte_array(target.c, TEST_LEN, 0x0); > bt_bitfield_write(target.l, long, s, l, src); > bt_bitfield_read(target.c, signed char, s, l, &readval); > - if (readval != src) { > - printf("Error (longwise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > + if (check_result(src, readval, target.c, long, > + s, l, SIGNED_TEST_DESC_FMT_STR)) { > + return; > } > > init_byte_array(target.c, TEST_LEN, 0x0); > bt_bitfield_write(target.ll, long long, s, l, src); > bt_bitfield_read(target.c, signed char, s, l, &readval); > - if (readval != src) { > - printf("Error (longlongwise) src %X read %llX shift %d len %d\n", > - src, readval, s, l); > - print_byte_array(target.c, TEST_LEN); > - err = 1; > + if (check_result(src, readval, target.c, long long, > + s, l, SIGNED_TEST_DESC_FMT_STR)) { > + return; > } > } > } > - if (!err) > - printf("Success!\n"); > - else > - printf("Failed!\n"); > - return err; > + > + pass(SIGNED_TEST_DESC_FMT_STR, src); > } > > -int run_test(void) > +void run_test(void) > { > - int err = 0; > int i; > + plan_tests(NR_TESTS * 2 + 6); > > srand(time(NULL)); > > srcrand = 0; > - err |= run_test_unsigned(); > + run_test_unsigned(); > srcrand = 0; > - err |= run_test_signed(); > + run_test_signed(); > + > srcrand = 1; > - err |= run_test_unsigned(); > + run_test_unsigned(); > + > srcrand = ~0U; > - err |= run_test_unsigned(); > + run_test_unsigned(); > + > srcrand = -1; > - err |= run_test_signed(); > + run_test_signed(); > + > srcrand = (int)0x80000000U; > - err |= run_test_signed(); > + run_test_signed(); > > for (i = 0; i < NR_TESTS; i++) { > srcrand = rand(); > - err |= run_test_unsigned(); > - err |= run_test_signed(); > + run_test_unsigned(); > + run_test_signed(); > } > - return err; > } > > int main(int argc, char **argv) > { > - unsigned long src; > - unsigned int shift, len; > - int ret; > - union { > - unsigned char c[8]; > - unsigned short s[4]; > - unsigned int i[2]; > - unsigned long l[2]; > - unsigned long long ll[1]; > - } target; > - unsigned long long readval; > + if (argc > 1) { > + /* Run interactive tests */ > + unsigned long src; > + unsigned int shift, len; > + union { > + unsigned char c[8]; > + unsigned short s[4]; > + unsigned int i[2]; > + unsigned long l[2]; > + unsigned long long ll[1]; > + } target; > + unsigned long long readval; > > - if (argc > 1) > src = atoi(argv[1]); > - else > - src = 0x12345678; > - if (argc > 2) > - shift = atoi(argv[2]); > - else > - shift = 12; > - if (argc > 3) > - len = atoi(argv[3]); > - else > - len = 40; > - > - target.i[0] = 0xFFFFFFFF; > - target.i[1] = 0xFFFFFFFF; > - bt_bitfield_write(target.c, unsigned char, shift, len, src); > - printf("bytewise\n"); > - print_byte_array(target.c, 8); > - > - target.i[0] = 0xFFFFFFFF; > - target.i[1] = 0xFFFFFFFF; > - bt_bitfield_write(target.s, unsigned short, shift, len, src); > - printf("shortwise\n"); > - print_byte_array(target.c, 8); > - > - target.i[0] = 0xFFFFFFFF; > - target.i[1] = 0xFFFFFFFF; > - bt_bitfield_write(target.i, unsigned int, shift, len, src); > - printf("intwise\n"); > - print_byte_array(target.c, 8); > - > - target.i[0] = 0xFFFFFFFF; > - target.i[1] = 0xFFFFFFFF; > - bt_bitfield_write(target.l, unsigned long, shift, len, src); > - printf("longwise\n"); > - print_byte_array(target.c, 8); > - > - target.i[0] = 0xFFFFFFFF; > - target.i[1] = 0xFFFFFFFF; > - bt_bitfield_write(target.ll, unsigned long long, shift, len, src); > - printf("lluwise\n"); > - print_byte_array(target.c, 8); > - > - bt_bitfield_read(target.c, unsigned char, shift, len, &readval); > - printf("read: %llX\n", readval); > - > - ret = run_test(); > - > - return ret; > + if (argc > 2) > + shift = atoi(argv[2]); > + else > + shift = 12; > + if (argc > 3) > + len = atoi(argv[3]); > + else > + len = 40; > + > + init_byte_array(target.c, 8, 0xFF); > + bt_bitfield_write(target.c, unsigned char, shift, len, src); > + printf("bytewise\n"); > + print_byte_array(target.c, 8); > + > + init_byte_array(target.c, 8, 0xFF); > + bt_bitfield_write(target.s, unsigned short, shift, len, src); > + printf("shortwise\n"); > + print_byte_array(target.c, 8); > + > + init_byte_array(target.c, 8, 0xFF); > + bt_bitfield_write(target.i, unsigned int, shift, len, src); > + printf("intwise\n"); > + print_byte_array(target.c, 8); > + > + init_byte_array(target.c, 8, 0xFF); > + bt_bitfield_write(target.l, unsigned long, shift, len, src); > + printf("longwise\n"); > + print_byte_array(target.c, 8); > + > + init_byte_array(target.c, 8, 0xFF); > + bt_bitfield_write(target.ll, unsigned long long, shift, len, src); > + printf("lluwise\n"); > + print_byte_array(target.c, 8); > + > + bt_bitfield_read(target.c, unsigned char, shift, len, &readval); > + printf("read: %llX\n", readval); > + print_byte_array(target.c, 8); > + > + return 0; > + } > + > + /* Run tap-formated tests */ > + run_test(); > + return exit_status(); > } > diff --git a/tests/runall.sh b/tests/runall.sh > index 9e0bdca..c10e88a 100755 > --- a/tests/runall.sh > +++ b/tests/runall.sh > @@ -5,44 +5,20 @@ DIR=$(readlink -f ${TESTDIR}) > BABELTRACE_BIN=${DIR}/../converter/babeltrace > CTF_TRACES=${DIR}/ctf-traces > > -function print_ok () > -{ > - # Check if we are a terminal > - if [ -t 1 ]; then > - echo -e "\e[1;32mOK\e[0m" > - else > - echo -e "OK" > - fi > -} > - > -function print_fail () > -{ > - # Check if we are a terminal > - if [ -t 1 ]; then > - echo -e "\e[1;31mFAIL\e[0m" > - else > - echo -e "FAIL" > - fi > -} > - > -function test_check () > +function test_check_success () > { > if [ $? -ne 0 ] ; then > - print_fail > return 1 > else > - print_ok > return 0 > fi > } > > function test_check_fail () > { > - if [ $? -ne 1 ] ; then > - print_fail > + if [ $? -eq 0 ] ; then > return 1 > else > - print_ok > return 0 > fi > } > @@ -53,38 +29,48 @@ function run_babeltrace () > return $? > } > > -#run babeltrace expects success > -echo -e "Running babeltrace without argument..." > -run_babeltrace > -test_check > -if [ $? -ne 0 ]; then > - exit 1 > -fi > - > -for a in ${CTF_TRACES}/succeed/*; do > - echo -e "Running babeltrace for trace ${a}..." > - run_babeltrace ${a} > - test_check > - if [ $? -ne 0 ]; then > +function print_test_result () > +{ > + if [ $# -ne 3 ] ; then > + echo "Invalid arguments provided" > exit 1 > fi > -done > > -#run babeltrace expects failure > -echo -e "Running babeltrace with bogus argument..." > + if [ ${2} -eq 0 ] ; then > + echo -n "ok" > + else > + echo -n "not ok" > + fi > + echo -e " "${1}" - "${3} > +} > + > +successTraces=(${CTF_TRACES}/succeed/*) > +failTraces=(${CTF_TRACES}/fail/*) > +testCount=$((2 + ${#successTraces[@]} + ${#failTraces[@]})) > + > +currentTestIndex=1 > +echo -e 1..${testCount} > + > +#run babeltrace, expects success > +run_babeltrace > +test_check_success > +print_test_result $((currentTestIndex++)) $? "Running babeltrace without arguments" > + > +#run babeltrace with a bogus argument, expects failure > run_babeltrace --bogusarg > test_check_fail > -if [ $? -ne 0 ]; then > - exit 1 > -fi > +print_test_result $((currentTestIndex++)) $? "Running babeltrace with a bogus argument" > + > +for tracePath in ${successTraces[@]}; do > + run_babeltrace ${tracePath} > + test_check_success > + print_test_result $((currentTestIndex++)) $? "Running babeltrace with trace ${tracePath}" > +done > > -for a in ${CTF_TRACES}/fail/*; do > - echo -e "Running babeltrace for trace ${a}..." > - run_babeltrace ${a} > +for tracePath in ${failTraces[@]}; do > + run_babeltrace ${tracePath} > test_check_fail > - if [ $? -ne 0 ]; then > - exit 1 > - fi > + print_test_result $((currentTestIndex++)) $? "Running babeltrace with trace ${tracePath}" > done > > exit 0 > -- > 1.8.1.1 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From michel.dagenais at polymtl.ca Wed Feb 13 15:35:06 2013 From: michel.dagenais at polymtl.ca (Michel Dagenais) Date: Wed, 13 Feb 2013 15:35:06 -0500 (EST) Subject: [lttng-dev] [RFC] on-disk multiple tracefiles circular buffer In-Reply-To: <511AA7AF.60102@efficios.com> Message-ID: <501458912.795461360787706118.JavaMail.root@srv12.zimbra.polymtl.ca> > -C limits the maximum file size and -W the amount of such files to > keep on disk. Do you round up to the next packet / subbuffer / event? In the upcoming releases, there should be small indexes telling where each packet / subbuffer starts in each file. How are these index files affected by these switches? From Daniel.Thibault at drdc-rddc.gc.ca Wed Feb 13 16:23:43 2013 From: Daniel.Thibault at drdc-rddc.gc.ca (Thibault, Daniel) Date: Wed, 13 Feb 2013 21:23:43 +0000 Subject: [lttng-dev] calibrate ? Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD016445@VAL-E-02.valcartier.drdc-rddc.gc.ca> I took note of http://lwn.net/Articles/492296/ (Mathieu Desnoyers, Julien Desfossez, David Goulet; LTTng 2.0: Tracing for power users and developers - part 2, April 18, 2012) and ran this (using the Ubuntu lttng packages this time; babeltrace is 1.0.0~rc1-0ubuntu1 and lttng is 2.0.1-0ubuntu1 [liblttng-ctl0, lttng-tools] and 2.0.2-0ubuntu1 [liblttng-ust0, lttng-modules-dkms]): $ sudo -H lttng create calibrate-session Session calibrate-session created. Traces will be written in /root/lttng-traces/calibrate-session-20130213-143220 $ sudo -H lttng enable-event calibrate-event -k --function lttng_calibrate_kretprobe kernel event calibrate-event created in channel channel0 $ sudo -H lttng add-context -k -t perf:LLC-load-misses -t perf:LLC-store-misses -t perf:LLC-prefetch-misses Error: perf:LLC-prefetch-misses: Add kernel context failed kernel context perf:LLC-store-misses added to all channels kernel context perf:LLC-load-misses added to all channels Warning: Some command(s) went wrong $ sudo -H lttng start Tracing started for session calibrate-session $ for a in $(seq 1 10); do \ > sudo -H lttng calibrate -k --function; \ > done Kernel calibration done Kernel calibration done Kernel calibration done Kernel calibration done Kernel calibration done Kernel calibration done Kernel calibration done Kernel calibration done Kernel calibration done Kernel calibration done $ sudo -H lttng destroy Session calibrate-session destroyed at /root $ sudo -H babeltrace /root/lttng-traces/calibrate-session-20130213-143220 error syntax error [error] Error creating AST [warning] Unable to open trace metadata for path "/root/lttng-traces/calibrate-session-20130213-143220/kernel". [warning] [Context] Cannot open_trace of the format /root/lttng-traces/calibrate-session-20130213-143220/kernel . [warning] [Context] opening trace "/root/lttng-traces/calibrate-session-20130213-143220/kernel" from /root/lttng-traces/calibrate-session-20130213-143220 for reading. ########## Now, the "Error: perf:LLC-prefetch-misses: Add kernel context failed" is probably because 'dmesg | grep "generic r"' reports just two generic registers, although it seems odd the error would occur on the first context attempt and not the last. My real problem is with the trace thus generated and babeltrace's handling of it. It consists of five files: metadata and channel0_0 through channel0_3. There is no kernel file. I moved the trace to another machine and tried a more up-to-date babeltrace (babeltrace-1.0.3+-217b52c), with little difference: error syntax error [error] Error creating AST [warning] Unable to open trace metadata for path "/home/daniel/lttng-traces/calibrate-session-20130213-143220/kernel". [warning] [Context] Cannot open_trace of format ctf at path /home/daniel/lttng-traces/calibrate-session-20130213-143220/kernel. [warning] [Context] cannot open trace "/home/daniel/lttng-traces/calibrate-session-20130213-143220/kernel" from /home/daniel/lttng-traces/calibrate-session-20130213-143220 for reading. [error] Cannot open any trace for reading. Daniel U. Thibault R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) / Defence R&D Canada - Valcartier (DRDC Valcartier) Cyber s?curit? pour les missions essentielles (CME) / Mission Critical Cyber Security (MCCS) Protection des syst?mes et contremesures (PSC) / Systems Protection & Countermeasures (SPC) 2459 route de la Bravoure Qu?bec, QC? G3J 1X5 CANADA Vox?: (418) 844-4000 x4245 Fax?: (418) 844-4538 NAC?: 918V QSDJ Gouvernement du Canada?/ Government of Canada From David.OShea at quantum.com Wed Feb 13 23:52:28 2013 From: David.OShea at quantum.com (David OShea) Date: Thu, 14 Feb 2013 04:52:28 +0000 Subject: [lttng-dev] How to disable an event that's been enabled by a wildcard selection or -a? In-Reply-To: <009B25148989C6458484484699278506985C0CFA@EU-MBX-01.mgc.mentorg.com> References: <009B25148989C6458484484699278506985C0CFA@EU-MBX-01.mgc.mentorg.com> Message-ID: <20998D40D9A2B7499CA5A3A2666CB1EB19F968AF@ZURMSG1.QUANTUM.com> Hi, My understanding (hopefully someone will correct me if I'm wrong) is that each time you invoke 'lttng enable-event', your specification for the events you want enabled is stored and applied, and/or potentially applied later if a new application connects to the session daemon. All 'lttng disable-event' does is remove one of the specifications you previously provided to 'lttng enable-event', so you can't say 'enable-event *' and then 'disable-event foo:*' to get all events except 'foo:*'. If you could constrain the application to use a particular trace provider name for all of its tracepoints, say "app", then you could just do 'lttng enable-event app:*'. If you can't do that, then I think you need to fall back on getting a list of all the available tracepoints using 'lttng list -u', parsing this to find all of the available tracepoints, extracting the trace provider name from them, then using 'lttng enable-event :*' for each provider other than the provider from your uninteresting library. I think there are APIs that can be used instead of issuing the 'lttng' commands. I would certainly also like a way to be able to, say, enable all events other than foo:* and bar:* using one command. Regards, David > -----Original Message----- > From: Ikaheimonen, JP [mailto:jp_ikaheimonen at mentor.com] > Sent: Friday, 8 February 2013 7:56 PM > To: lttng-dev at lists.lttng.org > Subject: [lttng-dev] How to disable an event that's been enabled by a > wildcard selection or -a? > > Consider the following scenario. > I want to write a script that traces all UST tracepoints of a given > application. I have no idea what the names of these tracepoints are. > Also, I know that the application uses a library that contains some > tracepoints I am not interested about. Now I want to trace all UST > tracepoints except the ones I already know about. Is this possible with > the lttng commands? > > If I enable all tracepoints with "lttng enable-event -u -a" I get all > events, even those I do not want. I've tried using "lttng disable- > event", and "lttng enable-event" with a filter, but I cannot seem to be > able to get rid of the specific events. > > Thank you, > > JP Ikaheimonen > Mentor Graphics Embedded Systems Division > Nucleus(r) | Linux(r) | Android(tm) | Services | UI | Multi-OS > > Android is a trademark of Google Inc. Use of this trademark is subject > to Google Permissions. > Linux is the registered trademark of Linus Torvalds in the U.S. and > other countries. > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev ---------------------------------------------------------------------- The information contained in this transmission may be confidential. Any disclosure, copying, or further distribution of confidential information is not permitted unless such privilege is explicitly granted in writing by Quantum. Quantum reserves the right to have electronic communications, including email and attachments, sent across its networks filtered through anti virus and spam software programs and retain such messages in order to comply with applicable data security and retention requirements. Quantum is not responsible for the proper and complete transmission of the substance of this communication or for any delay in its receipt. From jdesfossez at efficios.com Thu Feb 14 00:11:59 2013 From: jdesfossez at efficios.com (Julien Desfossez) Date: Thu, 14 Feb 2013 00:11:59 -0500 Subject: [lttng-dev] [RFC] on-disk multiple tracefiles circular buffer In-Reply-To: <501458912.795461360787706118.JavaMail.root@srv12.zimbra.polymtl.ca> References: <501458912.795461360787706118.JavaMail.root@srv12.zimbra.polymtl.ca> Message-ID: <511C721F.6060600@efficios.com> >> -C limits the maximum file size and -W the amount of such files to >> keep on disk. > > Do you round up to the next packet / subbuffer / event? We won't exceed the maximum file size specified, so when we detect that a write will be too big, we rotate the tracefile before writing in it. The smallest file size the user can specify will be the subbuffer size. > In the upcoming releases, there should be small indexes telling where each packet / subbuffer starts in each file. How are these index files affected by these switches? There will be one index file per tracefile, so the logic to write the index file will be the same as the logic to write the tracefile : when we rotate the tracefile, we rotate the index file. It is a good question since we might end up with a lot of files though, for each channel : 2*CPU*tracefile_count. I'd like to hear what the others have to say about that. Thank you, Julien From bigeasy at linutronix.de Thu Feb 14 06:54:04 2013 From: bigeasy at linutronix.de (Sebastian Andrzej Siewior) Date: Thu, 14 Feb 2013 12:54:04 +0100 Subject: [lttng-dev] babeltrace converting text <=> ctf Message-ID: <20130214115404.GA13194@linutronix.de> I started lltng to dump a few kernel events, nothing special. Once I had the binary CTF I converted it to text output via |babeltrace -w trace.txt kernel/ | [10:40:10.357768920] (+?.?????????) squsb kmalloc: { cpu_id = 3 }, { call_site = ? | [10:40:10.357785010] (+0.000016090) squsb kfree: { cpu_id = 3 }, { call_site = ? | [10:40:10.357800700] (+0.000015690) squsb kmalloc: { cpu_id = 3 }, { call_site = ? and now back to CTF. Since babeltrace does not support text as input or CTF as output (and the error message was not giving a hint) I tried it with babeltrace-log: |babeltrace-log < trace.txt ctf_v1 and now back to text: |babeltrace -w ctv_v1.txt ctf_v1 and I got: | 0 string: { }, { str = "[10:40:10.357768920] (+?.?????????) squsb kmalloc: { cpu_id = 3 }, { call_site = ? | 0 string: { }, { str = "[10:40:10.357785010] (+0.000016090) squsb kfree: { cpu_id = 3 }, { call_site = ? | 0 string: { }, { str = "[10:40:10.357800700] (+0.000015690) squsb kmalloc: { cpu_id = 3 }, { call_site = ? What I don't like here, is that the timestamp information is lost. Looking at babeltrace-log I noticed a timestamp option. So I tried this: |babeltrace-log -t < trace.txt ctf_v2 |babeltrace -w ctv_v2.txt ctf_v2 |[error] Invalid magic number 0x0 at packet 26 (file offset 851968). |[error] Open file stream error. buh. After looking at babeltrace-log I noticed that the sscanf() does not match anything because the timestamp value is different. So I tried to change the input so the sscanf() will match: |babeltrace -w trace_seconds.txt --clock-seconds kernel/ |babeltrace-log -t < trace_seconds.txt ctf_v3 |babeltrace -w ctf_v3.txt ctf_v3/ |[error] Invalid magic number 0x1F72CF7C at packet 81 (file offset 2654208). |[error] Open file stream error. Little different but still doesn't work. Could this be an user error or an easy to spot CTF libary bug? Sebastian From mathieu.desnoyers at efficios.com Thu Feb 14 10:39:40 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 14 Feb 2013 10:39:40 -0500 Subject: [lttng-dev] [PATCH] babeltrace: make '-w' actually work In-Reply-To: <1360839138-16265-1-git-send-email-bigeasy@linutronix.de> References: <1360839138-16265-1-git-send-email-bigeasy@linutronix.de> Message-ID: <20130214153940.GA29405@Krystal> * Sebastian Andrzej Siewior (bigeasy at linutronix.de) wrote: > Signed-off-by: Sebastian Andrzej Siewior Good catch ! Merged, thanks! Mathieu > --- > converter/babeltrace.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/converter/babeltrace.c b/converter/babeltrace.c > index fe7d39f..31e3d6e 100644 > --- a/converter/babeltrace.c > +++ b/converter/babeltrace.c > @@ -109,7 +109,7 @@ enum { > */ > static struct poptOption long_options[] = { > /* longName, shortName, argInfo, argPtr, value, descrip, argDesc */ > - { "output", 'w', POPT_ARG_STRING, NULL, OPT_NONE, NULL, NULL }, > + { "output", 'w', POPT_ARG_STRING, NULL, OPT_OUTPUT_PATH, NULL, NULL }, > { "input-format", 'i', POPT_ARG_STRING, NULL, OPT_INPUT_FORMAT, NULL, NULL }, > { "output-format", 'o', POPT_ARG_STRING, NULL, OPT_OUTPUT_FORMAT, NULL, NULL }, > { "help", 'h', POPT_ARG_NONE, NULL, OPT_HELP, NULL, NULL }, > -- > 1.7.10.4 > -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From bigeasy at linutronix.de Thu Feb 14 05:52:17 2013 From: bigeasy at linutronix.de (Sebastian Andrzej Siewior) Date: Thu, 14 Feb 2013 11:52:17 +0100 Subject: [lttng-dev] [PATCH] babeltrace: make '-w' actually work Message-ID: <1360839138-16265-1-git-send-email-bigeasy@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior --- converter/babeltrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/converter/babeltrace.c b/converter/babeltrace.c index fe7d39f..31e3d6e 100644 --- a/converter/babeltrace.c +++ b/converter/babeltrace.c @@ -109,7 +109,7 @@ enum { */ static struct poptOption long_options[] = { /* longName, shortName, argInfo, argPtr, value, descrip, argDesc */ - { "output", 'w', POPT_ARG_STRING, NULL, OPT_NONE, NULL, NULL }, + { "output", 'w', POPT_ARG_STRING, NULL, OPT_OUTPUT_PATH, NULL, NULL }, { "input-format", 'i', POPT_ARG_STRING, NULL, OPT_INPUT_FORMAT, NULL, NULL }, { "output-format", 'o', POPT_ARG_STRING, NULL, OPT_OUTPUT_FORMAT, NULL, NULL }, { "help", 'h', POPT_ARG_NONE, NULL, OPT_HELP, NULL, NULL }, -- 1.7.10.4 From mathieu.desnoyers at efficios.com Thu Feb 14 11:19:33 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 14 Feb 2013 11:19:33 -0500 Subject: [lttng-dev] [PATCH urcu] rculfhash: add assertions on node alignment Message-ID: <20130214161932.GA29790@Krystal> I've had a report of someone running into issues with the RCU lock-free hash table by embedding the struct cds_lfht_node into a packed structure by mistake, thus not respecting alignment requirements stated in urcu/rculfhash.h. Assertions on "replace" and "add" operations should catch this, but I notice that we should add assertions on the REMOVAL_OWNER_FLAG to cover all possible misalignments. Signed-off-by: Mathieu Desnoyers --- diff --git a/rculfhash.c b/rculfhash.c index 8c3d621..e0be7df 100644 --- a/rculfhash.c +++ b/rculfhash.c @@ -833,13 +833,16 @@ void _cds_lfht_gc_bucket(struct cds_lfht_node *bucket, struct cds_lfht_node *nod assert(!is_bucket(bucket)); assert(!is_removed(bucket)); + assert(!is_removal_owner(bucket)); assert(!is_bucket(node)); assert(!is_removed(node)); + assert(!is_removal_owner(node)); for (;;) { iter_prev = bucket; /* We can always skip the bucket node initially */ iter = rcu_dereference(iter_prev->next); assert(!is_removed(iter)); + assert(!is_removal_owner(iter)); assert(iter_prev->reverse_hash <= node->reverse_hash); /* * We should never be called with bucket (start of chain) @@ -860,6 +863,7 @@ void _cds_lfht_gc_bucket(struct cds_lfht_node *bucket, struct cds_lfht_node *nod iter = next; } assert(!is_removed(iter)); + assert(!is_removal_owner(iter)); if (is_bucket(iter)) new_next = flag_bucket(clear_flag(next)); else @@ -880,8 +884,10 @@ int _cds_lfht_replace(struct cds_lfht *ht, unsigned long size, return -ENOENT; assert(!is_removed(old_node)); + assert(!is_removal_owner(old_node)); assert(!is_bucket(old_node)); assert(!is_removed(new_node)); + assert(!is_removal_owner(new_node)); assert(!is_bucket(new_node)); assert(new_node != old_node); for (;;) { @@ -956,6 +962,7 @@ void _cds_lfht_add(struct cds_lfht *ht, assert(!is_bucket(node)); assert(!is_removed(node)); + assert(!is_removal_owner(node)); bucket = lookup_bucket(ht, size, hash); for (;;) { uint32_t chain_len = 0; @@ -1016,7 +1023,9 @@ void _cds_lfht_add(struct cds_lfht *ht, insert: assert(node != clear_flag(iter)); assert(!is_removed(iter_prev)); + assert(!is_removal_owner(iter_prev)); assert(!is_removed(iter)); + assert(!is_removal_owner(iter)); assert(iter_prev != node); if (!bucket_flag) node->next = clear_flag(iter); @@ -1036,6 +1045,7 @@ void _cds_lfht_add(struct cds_lfht *ht, gc_node: assert(!is_removed(iter)); + assert(!is_removal_owner(iter)); if (is_bucket(iter)) new_next = flag_bucket(clear_flag(next)); else @@ -1700,6 +1710,7 @@ int cds_lfht_delete_bucket(struct cds_lfht *ht) if (!is_bucket(node)) return -EPERM; assert(!is_removed(node)); + assert(!is_removal_owner(node)); } while (!is_end(node)); /* * size accessed without rcu_dereference because hash table is -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From Daniel.Thibault at drdc-rddc.gc.ca Thu Feb 14 16:32:51 2013 From: Daniel.Thibault at drdc-rddc.gc.ca (Thibault, Daniel) Date: Thu, 14 Feb 2013 21:32:51 +0000 Subject: [lttng-dev] Scope of event names? Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD016655@VAL-E-02.valcartier.drdc-rddc.gc.ca> I'm operating under the assumption that an event's "fully qualified" identifier is something like session:domain:channel:name. Tracepoints and syscalls have system-defined names, and of course the domain can only be 'kernel' or 'userspace', but everything else is pretty much arbitrary. My hypothesis is thus that, as long as they're in different channels (or domains or possibly sessions), two events may bear the same name even though they represent completely different occurrences. So here's what I did (lttng list output has been abridged), with comments interspersed: $ sudo -H lttng create asession Session asession created. Traces will be written in /root/lttng-traces/asession-20130214-145626 $ sudo -H lttng enable-event sched_switch -k --tracepoint kernel event sched_switch created in channel channel0 $ sudo -H lttng enable-event sched_switch -k --function lttng_calibrate_kretprobe --channel channel1 Error: Event sched_switch: Enable kernel event failed (channel channel1, session asession) Warning: Some command(s) went wrong /* Okay, so maybe event names have session:domain scope. Let's test this. */ $ sudo -H lttng enable-event fevent -k --function lttng_calibrate_kretprobe --channel channel1 kernel event fevent created in channel channel1 $ sudo -H lttng enable-event fevent -k --function lttng_calibrate_kretprobe --channel channel2 kernel event fevent created in channel channel2 /* Apparently not. */ $ sudo -H lttng list asession Tracing session asession: [inactive] === Domain: Kernel === - channel2: [enabled] Events: fevent (type: probe) [enabled] offset: 0x0 symbol: lttng_calibrate_kretprobe - channel1: [enabled] Events: fevent (type: probe) [enabled] offset: 0x0 symbol: lttng_calibrate_kretprobe - channel0: [enabled] Events: sched_switch (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled] /* Instead of tracepoint then function, let's try function then tracepoint */ $ sudo -H lttng enable-event sched_process_fork -k --function lttng_calibrate_kretprobe --channel channel3 kernel event sched_process_fork created in channel channel3 $ sudo -H lttng enable-event sched_process_fork -k kernel event sched_process_fork created in channel channel0 $ sudo -H lttng enable-event sched_process_fork -k --function lttng_calibrate_kretprobe --channel channel4 Error: Event sched_process_fork: Enable kernel event failed (channel channel4, session asession) Warning: Some command(s) went wrong /* Fascinating. */ $ sudo -H lttng list asession Tracing session asession: [inactive] - channel3: [enabled] Events: sched_process_fork (type: probe) [enabled] offset: 0x0 symbol: lttng_calibrate_kretprobe - channel2: [enabled] Events: fevent (type: probe) [enabled] offset: 0x0 symbol: lttng_calibrate_kretprobe - channel1: [enabled] Events: fevent (type: probe) [enabled] offset: 0x0 symbol: lttng_calibrate_kretprobe - channel0: [enabled] Events: sched_process_fork (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled] sched_switch (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled] At this point it looks like defining a kernel tracepoint prevents that tracepoint's name from being used in other channels to define other events (or even the same event). But nothing apparently prevents these other events from being set up *before* the tracepoint. (Not shown here is the case where a tracepoint is defined in one channel, and then in another: the second tracepoint event definition fails as well) Can anyone shed light on this? (Note that I haven't even tried yet to see what happens between simultaneous sessions...) The control flow of the error-causing commands is something like: event.c's event_kernel_enable_tracepoint returns LTTNG_ERR_KERN_ENABLE_FAIL because kernel.c's kernel_create_event gets something else than ENOSYS or EEXIST from kernel-ctl.c's kernctl_create_event Beyond kernctl_create_event is debugfs, inside of which occurs...whatever. Daniel U. Thibault R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) / Defence R&D Canada - Valcartier (DRDC Valcartier) Cyber s?curit? pour les missions essentielles (CME) / Mission Critical Cyber Security (MCCS) Protection des syst?mes et contremesures (PSC) / Systems Protection & Countermeasures (SPC) 2459 route de la Bravoure Qu?bec, QC? G3J 1X5 CANADA Vox?: (418) 844-4000 x4245 Fax?: (418) 844-4538 NAC?: 918V QSDJ Gouvernement du Canada?/ Government of Canada From mathieu.desnoyers at efficios.com Thu Feb 14 18:39:09 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 14 Feb 2013 18:39:09 -0500 Subject: [lttng-dev] [RELEASE] LTTng modules 2.1.1 Message-ID: <20130214233909.GA1097@Krystal> The LTTng modules provide Linux kernel tracing capability to the LTTng 2.0 tracer toolset. Changelog: 2013-02-14 LTTng modules 2.1.1 * Fix: statedump: missing locking, use lttng_iterate_fd * Implement lttng_iterate_fd wrapper * Fix check in lttng_strlen_user_inatomic * Fix: statedump hang/too early completion due to logic error * Fix: statedump hang due to incorrect wait/wakeup use Project website: http://lttng.org Download link: http://lttng.org/download (please refer to the README files for installation instructions and lttng-tools doc/quickstart.txt for usage information) -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From paulmck at linux.vnet.ibm.com Thu Feb 14 19:00:57 2013 From: paulmck at linux.vnet.ibm.com (Paul E. McKenney) Date: Thu, 14 Feb 2013 16:00:57 -0800 Subject: [lttng-dev] [rp] [PATCH urcu] rculfhash: add assertions on node alignment In-Reply-To: <20130214161932.GA29790@Krystal> References: <20130214161932.GA29790@Krystal> Message-ID: <20130215000057.GF2769@linux.vnet.ibm.com> On Thu, Feb 14, 2013 at 11:19:33AM -0500, Mathieu Desnoyers wrote: > I've had a report of someone running into issues with the RCU lock-free > hash table by embedding the struct cds_lfht_node into a packed structure > by mistake, thus not respecting alignment requirements stated in > urcu/rculfhash.h. Assertions on "replace" and "add" operations should > catch this, but I notice that we should add assertions on the > REMOVAL_OWNER_FLAG to cover all possible misalignments. > > Signed-off-by: Mathieu Desnoyers Makes sense to me! Thanx, Paul > --- > diff --git a/rculfhash.c b/rculfhash.c > index 8c3d621..e0be7df 100644 > --- a/rculfhash.c > +++ b/rculfhash.c > @@ -833,13 +833,16 @@ void _cds_lfht_gc_bucket(struct cds_lfht_node *bucket, struct cds_lfht_node *nod > > assert(!is_bucket(bucket)); > assert(!is_removed(bucket)); > + assert(!is_removal_owner(bucket)); > assert(!is_bucket(node)); > assert(!is_removed(node)); > + assert(!is_removal_owner(node)); > for (;;) { > iter_prev = bucket; > /* We can always skip the bucket node initially */ > iter = rcu_dereference(iter_prev->next); > assert(!is_removed(iter)); > + assert(!is_removal_owner(iter)); > assert(iter_prev->reverse_hash <= node->reverse_hash); > /* > * We should never be called with bucket (start of chain) > @@ -860,6 +863,7 @@ void _cds_lfht_gc_bucket(struct cds_lfht_node *bucket, struct cds_lfht_node *nod > iter = next; > } > assert(!is_removed(iter)); > + assert(!is_removal_owner(iter)); > if (is_bucket(iter)) > new_next = flag_bucket(clear_flag(next)); > else > @@ -880,8 +884,10 @@ int _cds_lfht_replace(struct cds_lfht *ht, unsigned long size, > return -ENOENT; > > assert(!is_removed(old_node)); > + assert(!is_removal_owner(old_node)); > assert(!is_bucket(old_node)); > assert(!is_removed(new_node)); > + assert(!is_removal_owner(new_node)); > assert(!is_bucket(new_node)); > assert(new_node != old_node); > for (;;) { > @@ -956,6 +962,7 @@ void _cds_lfht_add(struct cds_lfht *ht, > > assert(!is_bucket(node)); > assert(!is_removed(node)); > + assert(!is_removal_owner(node)); > bucket = lookup_bucket(ht, size, hash); > for (;;) { > uint32_t chain_len = 0; > @@ -1016,7 +1023,9 @@ void _cds_lfht_add(struct cds_lfht *ht, > insert: > assert(node != clear_flag(iter)); > assert(!is_removed(iter_prev)); > + assert(!is_removal_owner(iter_prev)); > assert(!is_removed(iter)); > + assert(!is_removal_owner(iter)); > assert(iter_prev != node); > if (!bucket_flag) > node->next = clear_flag(iter); > @@ -1036,6 +1045,7 @@ void _cds_lfht_add(struct cds_lfht *ht, > > gc_node: > assert(!is_removed(iter)); > + assert(!is_removal_owner(iter)); > if (is_bucket(iter)) > new_next = flag_bucket(clear_flag(next)); > else > @@ -1700,6 +1710,7 @@ int cds_lfht_delete_bucket(struct cds_lfht *ht) > if (!is_bucket(node)) > return -EPERM; > assert(!is_removed(node)); > + assert(!is_removal_owner(node)); > } while (!is_end(node)); > /* > * size accessed without rcu_dereference because hash table is > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com > > _______________________________________________ > rp mailing list > rp at svcs.cs.pdx.edu > http://svcs.cs.pdx.edu/mailman/listinfo/rp > From mathieu.desnoyers at efficios.com Thu Feb 14 20:00:54 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 14 Feb 2013 20:00:54 -0500 Subject: [lttng-dev] [rp] [PATCH urcu] rculfhash: add assertions on node alignment In-Reply-To: <20130215000057.GF2769@linux.vnet.ibm.com> References: <20130214161932.GA29790@Krystal> <20130215000057.GF2769@linux.vnet.ibm.com> Message-ID: <20130215010053.GA3015@Krystal> * Paul E. McKenney (paulmck at linux.vnet.ibm.com) wrote: > On Thu, Feb 14, 2013 at 11:19:33AM -0500, Mathieu Desnoyers wrote: > > I've had a report of someone running into issues with the RCU lock-free > > hash table by embedding the struct cds_lfht_node into a packed structure > > by mistake, thus not respecting alignment requirements stated in > > urcu/rculfhash.h. Assertions on "replace" and "add" operations should > > catch this, but I notice that we should add assertions on the > > REMOVAL_OWNER_FLAG to cover all possible misalignments. > > > > Signed-off-by: Mathieu Desnoyers > > Makes sense to me! Thanks for the feedback! Now merged into urcu master branch. Mathieu > > Thanx, Paul > > > --- > > diff --git a/rculfhash.c b/rculfhash.c > > index 8c3d621..e0be7df 100644 > > --- a/rculfhash.c > > +++ b/rculfhash.c > > @@ -833,13 +833,16 @@ void _cds_lfht_gc_bucket(struct cds_lfht_node *bucket, struct cds_lfht_node *nod > > > > assert(!is_bucket(bucket)); > > assert(!is_removed(bucket)); > > + assert(!is_removal_owner(bucket)); > > assert(!is_bucket(node)); > > assert(!is_removed(node)); > > + assert(!is_removal_owner(node)); > > for (;;) { > > iter_prev = bucket; > > /* We can always skip the bucket node initially */ > > iter = rcu_dereference(iter_prev->next); > > assert(!is_removed(iter)); > > + assert(!is_removal_owner(iter)); > > assert(iter_prev->reverse_hash <= node->reverse_hash); > > /* > > * We should never be called with bucket (start of chain) > > @@ -860,6 +863,7 @@ void _cds_lfht_gc_bucket(struct cds_lfht_node *bucket, struct cds_lfht_node *nod > > iter = next; > > } > > assert(!is_removed(iter)); > > + assert(!is_removal_owner(iter)); > > if (is_bucket(iter)) > > new_next = flag_bucket(clear_flag(next)); > > else > > @@ -880,8 +884,10 @@ int _cds_lfht_replace(struct cds_lfht *ht, unsigned long size, > > return -ENOENT; > > > > assert(!is_removed(old_node)); > > + assert(!is_removal_owner(old_node)); > > assert(!is_bucket(old_node)); > > assert(!is_removed(new_node)); > > + assert(!is_removal_owner(new_node)); > > assert(!is_bucket(new_node)); > > assert(new_node != old_node); > > for (;;) { > > @@ -956,6 +962,7 @@ void _cds_lfht_add(struct cds_lfht *ht, > > > > assert(!is_bucket(node)); > > assert(!is_removed(node)); > > + assert(!is_removal_owner(node)); > > bucket = lookup_bucket(ht, size, hash); > > for (;;) { > > uint32_t chain_len = 0; > > @@ -1016,7 +1023,9 @@ void _cds_lfht_add(struct cds_lfht *ht, > > insert: > > assert(node != clear_flag(iter)); > > assert(!is_removed(iter_prev)); > > + assert(!is_removal_owner(iter_prev)); > > assert(!is_removed(iter)); > > + assert(!is_removal_owner(iter)); > > assert(iter_prev != node); > > if (!bucket_flag) > > node->next = clear_flag(iter); > > @@ -1036,6 +1045,7 @@ void _cds_lfht_add(struct cds_lfht *ht, > > > > gc_node: > > assert(!is_removed(iter)); > > + assert(!is_removal_owner(iter)); > > if (is_bucket(iter)) > > new_next = flag_bucket(clear_flag(next)); > > else > > @@ -1700,6 +1710,7 @@ int cds_lfht_delete_bucket(struct cds_lfht *ht) > > if (!is_bucket(node)) > > return -EPERM; > > assert(!is_removed(node)); > > + assert(!is_removal_owner(node)); > > } while (!is_end(node)); > > /* > > * size accessed without rcu_dereference because hash table is > > > > -- > > Mathieu Desnoyers > > EfficiOS Inc. > > http://www.efficios.com > > > > _______________________________________________ > > rp mailing list > > rp at svcs.cs.pdx.edu > > http://svcs.cs.pdx.edu/mailman/listinfo/rp > > > -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From vivekkumar.p at gmail.com Fri Feb 15 03:52:36 2013 From: vivekkumar.p at gmail.com (Vivek Kumar) Date: Fri, 15 Feb 2013 14:22:36 +0530 Subject: [lttng-dev] Issue faced in logging the traces Message-ID: Hi, I am trying to port LTTng to my arm based board. For userspace tracing, I have been able to successfully port followings: LTTng-tools, LTT-ust Library Userspace-rcu libpopt Now I can see that lttng-sessiond is running, and am able to create sessions, enable-event and start and stop tracing. But, I don't see traces be logged in the home directory (indeed nothing happens, i.e, not even the creation of the base directory -> lttng-traces). Am I missing anything because of that LTTng is failing to log traces? Please help. Regards, Vivek -- Best, Vivek -------------- next part -------------- An HTML attachment was scrubbed... URL: From dgoulet at efficios.com Fri Feb 15 09:29:19 2013 From: dgoulet at efficios.com (David Goulet) Date: Fri, 15 Feb 2013 09:29:19 -0500 Subject: [lttng-dev] Issue faced in logging the traces In-Reply-To: References: Message-ID: <511E463F.2080605@efficios.com> Hi Vivek, In order to collect a trace you need to instrument your application with LTTng-UST tracepoints. If you like to gather the syscalls for instance, you need to install the LTTng modules and start your session daemon as root. If you are still experiencing problem, please provide the commands you use and setup. Thanks! David Vivek Kumar: > Hi, > > I am trying to port LTTng to my arm based board. > For userspace tracing, I have been able to successfully port followings: > LTTng-tools, > LTT-ust Library > Userspace-rcu > libpopt > > Now I can see that lttng-sessiond is running, and am able to create > sessions, enable-event and start and stop tracing. > But, I don't see traces be logged in the home directory (indeed nothing > happens, i.e, not even the creation of the base directory -> lttng-traces). > Am I missing anything because of that LTTng is failing to log traces? > Please help. > > Regards, Vivek > > > -- > Best, Vivek > > > This body part will be downloaded on demand. From jdesfossez at efficios.com Fri Feb 15 12:22:50 2013 From: jdesfossez at efficios.com (Julien Desfossez) Date: Fri, 15 Feb 2013 12:22:50 -0500 Subject: [lttng-dev] [BABELTRACE PATCH 1/7] Namespace compliance for dependencies function Message-ID: <1360948976-14999-1-git-send-email-jdesfossez@efficios.com> Use the bt_ prefix instead of babeltrace_ Signed-off-by: Julien Desfossez --- formats/ctf/callbacks.c | 6 +++--- include/babeltrace/ctf/callbacks.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/formats/ctf/callbacks.c b/formats/ctf/callbacks.c index 71e3248..793f3d3 100644 --- a/formats/ctf/callbacks.c +++ b/formats/ctf/callbacks.c @@ -38,7 +38,7 @@ #include static -struct bt_dependencies *_babeltrace_dependencies_create(const char *first, +struct bt_dependencies *_bt_dependencies_create(const char *first, va_list ap) { const char *iter; @@ -56,13 +56,13 @@ struct bt_dependencies *_babeltrace_dependencies_create(const char *first, return dep; } -struct bt_dependencies *babeltrace_dependencies_create(const char *first, ...) +struct bt_dependencies *bt_dependencies_create(const char *first, ...) { va_list ap; struct bt_dependencies *deps; va_start(ap, first); - deps = _babeltrace_dependencies_create(first, ap); + deps = _bt_dependencies_create(first, ap); va_end(ap); return deps; } diff --git a/include/babeltrace/ctf/callbacks.h b/include/babeltrace/ctf/callbacks.h index c178767..bc75769 100644 --- a/include/babeltrace/ctf/callbacks.h +++ b/include/babeltrace/ctf/callbacks.h @@ -51,13 +51,13 @@ enum bt_cb_ret { /* * Receives a variable number of strings as parameter, ended with NULL. */ -struct bt_dependencies *babeltrace_dependencies_create(const char *first, ...); +struct bt_dependencies *bt_dependencies_create(const char *first, ...); /* * struct bt_dependencies must be destroyed explicitly if not passed as * parameter to a bt_ctf_iter_add_callback(). */ -void babeltrace_dependencies_destroy(struct bt_dependencies *dep); +void bt_dependencies_destroy(struct bt_dependencies *dep); /* * bt_ctf_iter_add_callback: Add a callback to iterator. -- 1.7.10.4 From jdesfossez at efficios.com Fri Feb 15 12:22:51 2013 From: jdesfossez at efficios.com (Julien Desfossez) Date: Fri, 15 Feb 2013 12:22:51 -0500 Subject: [lttng-dev] [BABELTRACE PATCH 2/7] Namespace struct stream_pos In-Reply-To: <1360948976-14999-1-git-send-email-jdesfossez@efficios.com> References: <1360948976-14999-1-git-send-email-jdesfossez@efficios.com> Message-ID: <1360948976-14999-2-git-send-email-jdesfossez@efficios.com> This struct is exposed by the API, so we need to namespace it. Signed-off-by: Julien Desfossez --- converter/babeltrace.c | 2 +- formats/bt-dummy/bt-dummy.c | 4 ++-- formats/ctf-text/ctf-text.c | 6 +++--- formats/ctf-text/types/array.c | 2 +- formats/ctf-text/types/enum.c | 2 +- formats/ctf-text/types/float.c | 2 +- formats/ctf-text/types/integer.c | 2 +- formats/ctf-text/types/sequence.c | 2 +- formats/ctf-text/types/string.c | 2 +- formats/ctf-text/types/struct.c | 2 +- formats/ctf-text/types/variant.c | 2 +- formats/ctf/ctf.c | 24 +++++++++++------------ formats/ctf/types/array.c | 4 ++-- formats/ctf/types/enum.c | 4 ++-- formats/ctf/types/float.c | 8 ++++---- formats/ctf/types/integer.c | 8 ++++---- formats/ctf/types/sequence.c | 4 ++-- formats/ctf/types/string.c | 4 ++-- formats/ctf/types/struct.c | 2 +- formats/ctf/types/variant.c | 2 +- include/babeltrace/context.h | 4 ++-- include/babeltrace/ctf-text/types.h | 22 ++++++++++----------- include/babeltrace/ctf/types.h | 36 +++++++++++++++++------------------ include/babeltrace/format.h | 6 +++--- include/babeltrace/types.h | 18 +++++++++--------- lib/context.c | 2 +- types/array.c | 2 +- types/sequence.c | 2 +- types/struct.c | 2 +- types/variant.c | 2 +- 30 files changed, 92 insertions(+), 92 deletions(-) diff --git a/converter/babeltrace.c b/converter/babeltrace.c index 31e3d6e..b1f32c9 100644 --- a/converter/babeltrace.c +++ b/converter/babeltrace.c @@ -461,7 +461,7 @@ static int traverse_trace_dir(const char *fpath, const struct stat *sb, */ int bt_context_add_traces_recursive(struct bt_context *ctx, const char *path, const char *format_str, - void (*packet_seek)(struct stream_pos *pos, + void (*packet_seek)(struct bt_stream_pos *pos, size_t offset, int whence)) { diff --git a/formats/bt-dummy/bt-dummy.c b/formats/bt-dummy/bt-dummy.c index b55dd69..537e6bb 100644 --- a/formats/bt-dummy/bt-dummy.c +++ b/formats/bt-dummy/bt-dummy.c @@ -39,14 +39,14 @@ #include static -int bt_dummy_write_event(struct stream_pos *ppos, struct ctf_stream_definition *stream) +int bt_dummy_write_event(struct bt_stream_pos *ppos, struct ctf_stream_definition *stream) { return 0; } static struct trace_descriptor *bt_dummy_open_trace(const char *path, int flags, - void (*packet_seek)(struct stream_pos *pos, size_t index, + void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence), FILE *metadata_fp) { struct ctf_text_stream_pos *pos; diff --git a/formats/ctf-text/ctf-text.c b/formats/ctf-text/ctf-text.c index d344c1c..1f798b2 100644 --- a/formats/ctf-text/ctf-text.c +++ b/formats/ctf-text/ctf-text.c @@ -88,7 +88,7 @@ enum bt_loglevel { static struct trace_descriptor *ctf_text_open_trace(const char *path, int flags, - void (*packet_seek)(struct stream_pos *pos, size_t index, + void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence), FILE *metadata_fp); static int ctf_text_close_trace(struct trace_descriptor *descriptor); @@ -232,7 +232,7 @@ const char *print_loglevel(int value) } static -int ctf_text_write_event(struct stream_pos *ppos, struct ctf_stream_definition *stream) +int ctf_text_write_event(struct bt_stream_pos *ppos, struct ctf_stream_definition *stream) { struct ctf_text_stream_pos *pos = @@ -556,7 +556,7 @@ error: static struct trace_descriptor *ctf_text_open_trace(const char *path, int flags, - void (*packet_seek)(struct stream_pos *pos, size_t index, + void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence), FILE *metadata_fp) { struct ctf_text_stream_pos *pos; diff --git a/formats/ctf-text/types/array.c b/formats/ctf-text/types/array.c index e2ed7b3..9e7d49f 100644 --- a/formats/ctf-text/types/array.c +++ b/formats/ctf-text/types/array.c @@ -29,7 +29,7 @@ #include #include -int ctf_text_array_write(struct stream_pos *ppos, struct definition *definition) +int ctf_text_array_write(struct bt_stream_pos *ppos, struct definition *definition) { struct ctf_text_stream_pos *pos = ctf_text_pos(ppos); struct definition_array *array_definition = diff --git a/formats/ctf-text/types/enum.c b/formats/ctf-text/types/enum.c index 9df8da8..8a2463b 100644 --- a/formats/ctf-text/types/enum.c +++ b/formats/ctf-text/types/enum.c @@ -30,7 +30,7 @@ #include #include -int ctf_text_enum_write(struct stream_pos *ppos, struct definition *definition) +int ctf_text_enum_write(struct bt_stream_pos *ppos, struct definition *definition) { struct definition_enum *enum_definition = container_of(definition, struct definition_enum, p); diff --git a/formats/ctf-text/types/float.c b/formats/ctf-text/types/float.c index 199b013..a925480 100644 --- a/formats/ctf-text/types/float.c +++ b/formats/ctf-text/types/float.c @@ -31,7 +31,7 @@ #include #include -int ctf_text_float_write(struct stream_pos *ppos, struct definition *definition) +int ctf_text_float_write(struct bt_stream_pos *ppos, struct definition *definition) { struct definition_float *float_definition = container_of(definition, struct definition_float, p); diff --git a/formats/ctf-text/types/integer.c b/formats/ctf-text/types/integer.c index 0886b06..3a469f6 100644 --- a/formats/ctf-text/types/integer.c +++ b/formats/ctf-text/types/integer.c @@ -32,7 +32,7 @@ #include #include -int ctf_text_integer_write(struct stream_pos *ppos, struct definition *definition) +int ctf_text_integer_write(struct bt_stream_pos *ppos, struct definition *definition) { struct definition_integer *integer_definition = container_of(definition, struct definition_integer, p); diff --git a/formats/ctf-text/types/sequence.c b/formats/ctf-text/types/sequence.c index 12574ee..61be860 100644 --- a/formats/ctf-text/types/sequence.c +++ b/formats/ctf-text/types/sequence.c @@ -29,7 +29,7 @@ #include #include -int ctf_text_sequence_write(struct stream_pos *ppos, struct definition *definition) +int ctf_text_sequence_write(struct bt_stream_pos *ppos, struct definition *definition) { struct ctf_text_stream_pos *pos = ctf_text_pos(ppos); struct definition_sequence *sequence_definition = diff --git a/formats/ctf-text/types/string.c b/formats/ctf-text/types/string.c index 44aeb40..f49d1b7 100644 --- a/formats/ctf-text/types/string.c +++ b/formats/ctf-text/types/string.c @@ -31,7 +31,7 @@ #include /* C99 limits */ #include -int ctf_text_string_write(struct stream_pos *ppos, +int ctf_text_string_write(struct bt_stream_pos *ppos, struct definition *definition) { struct definition_string *string_definition = diff --git a/formats/ctf-text/types/struct.c b/formats/ctf-text/types/struct.c index e9365af..a727a89 100644 --- a/formats/ctf-text/types/struct.c +++ b/formats/ctf-text/types/struct.c @@ -29,7 +29,7 @@ #include #include -int ctf_text_struct_write(struct stream_pos *ppos, struct definition *definition) +int ctf_text_struct_write(struct bt_stream_pos *ppos, struct definition *definition) { struct declaration *declaration = definition->declaration; struct declaration_struct *struct_declaration = diff --git a/formats/ctf-text/types/variant.c b/formats/ctf-text/types/variant.c index e7e50ac..ca7c1ae 100644 --- a/formats/ctf-text/types/variant.c +++ b/formats/ctf-text/types/variant.c @@ -29,7 +29,7 @@ #include #include -int ctf_text_variant_write(struct stream_pos *ppos, struct definition *definition) +int ctf_text_variant_write(struct bt_stream_pos *ppos, struct definition *definition) { struct ctf_text_stream_pos *pos = ctf_text_pos(ppos); int field_nr_saved; diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index 552133c..c6b148c 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -77,13 +77,13 @@ extern int yydebug; static struct trace_descriptor *ctf_open_trace(const char *path, int flags, - void (*packet_seek)(struct stream_pos *pos, size_t index, + void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence), FILE *metadata_fp); static struct trace_descriptor *ctf_open_mmap_trace( struct mmap_stream_list *mmap_list, - void (*packet_seek)(struct stream_pos *pos, size_t index, + void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence), FILE *metadata_fp); static @@ -392,7 +392,7 @@ void ctf_print_timestamp(FILE *fp, } static -int ctf_read_event(struct stream_pos *ppos, struct ctf_stream_definition *stream) +int ctf_read_event(struct bt_stream_pos *ppos, struct ctf_stream_definition *stream) { struct ctf_stream_pos *pos = container_of(ppos, struct ctf_stream_pos, parent); @@ -504,7 +504,7 @@ error: } static -int ctf_write_event(struct stream_pos *pos, struct ctf_stream_definition *stream) +int ctf_write_event(struct bt_stream_pos *pos, struct ctf_stream_definition *stream) { struct ctf_stream_declaration *stream_class = stream->stream_class; struct ctf_event_definition *event; @@ -617,7 +617,7 @@ int ctf_fini_pos(struct ctf_stream_pos *pos) * for SEEK_CUR: go to next packet. * for SEEK_POS: go to packet numer (index). */ -void ctf_packet_seek(struct stream_pos *stream_pos, size_t index, int whence) +void ctf_packet_seek(struct bt_stream_pos *stream_pos, size_t index, int whence) { struct ctf_stream_pos *pos = container_of(stream_pos, struct ctf_stream_pos, parent); @@ -1018,7 +1018,7 @@ int ctf_open_trace_metadata_stream_read(struct ctf_trace *td, FILE **fp, static int ctf_open_trace_metadata_read(struct ctf_trace *td, - void (*packet_seek)(struct stream_pos *pos, size_t index, + void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence), FILE *metadata_fp) { struct ctf_scanner *scanner; @@ -1523,7 +1523,7 @@ error: */ static int ctf_open_file_stream_read(struct ctf_trace *td, const char *path, int flags, - void (*packet_seek)(struct stream_pos *pos, size_t index, + void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence)) { int ret, fd, closeret; @@ -1600,7 +1600,7 @@ error: static int ctf_open_trace_read(struct ctf_trace *td, const char *path, int flags, - void (*packet_seek)(struct stream_pos *pos, size_t index, + void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence), FILE *metadata_fp) { int ret, closeret; @@ -1696,7 +1696,7 @@ error: */ static struct trace_descriptor *ctf_open_trace(const char *path, int flags, - void (*packet_seek)(struct stream_pos *pos, size_t index, + void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence), FILE *metadata_fp) { struct ctf_trace *td; @@ -1786,7 +1786,7 @@ end: static int ctf_open_mmap_stream_read(struct ctf_trace *td, struct mmap_stream *mmap_info, - void (*packet_seek)(struct stream_pos *pos, size_t index, + void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence)) { int ret; @@ -1828,7 +1828,7 @@ error_def: static int ctf_open_mmap_trace_read(struct ctf_trace *td, struct mmap_stream_list *mmap_list, - void (*packet_seek)(struct stream_pos *pos, size_t index, + void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence), FILE *metadata_fp) { @@ -1861,7 +1861,7 @@ error: static struct trace_descriptor *ctf_open_mmap_trace( struct mmap_stream_list *mmap_list, - void (*packet_seek)(struct stream_pos *pos, size_t index, + void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence), FILE *metadata_fp) { diff --git a/formats/ctf/types/array.c b/formats/ctf/types/array.c index 006f0ce..b1cbe2f 100644 --- a/formats/ctf/types/array.c +++ b/formats/ctf/types/array.c @@ -28,7 +28,7 @@ #include -int ctf_array_read(struct stream_pos *ppos, struct definition *definition) +int ctf_array_read(struct bt_stream_pos *ppos, struct definition *definition) { struct definition_array *array_definition = container_of(definition, struct definition_array, p); @@ -64,7 +64,7 @@ int ctf_array_read(struct stream_pos *ppos, struct definition *definition) return bt_array_rw(ppos, definition); } -int ctf_array_write(struct stream_pos *ppos, struct definition *definition) +int ctf_array_write(struct bt_stream_pos *ppos, struct definition *definition) { struct definition_array *array_definition = container_of(definition, struct definition_array, p); diff --git a/formats/ctf/types/enum.c b/formats/ctf/types/enum.c index 1891175..9371b27 100644 --- a/formats/ctf/types/enum.c +++ b/formats/ctf/types/enum.c @@ -31,7 +31,7 @@ #include #include -int ctf_enum_read(struct stream_pos *ppos, struct definition *definition) +int ctf_enum_read(struct bt_stream_pos *ppos, struct definition *definition) { struct definition_enum *enum_definition = container_of(definition, struct definition_enum, p); @@ -69,7 +69,7 @@ int ctf_enum_read(struct stream_pos *ppos, struct definition *definition) return 0; } -int ctf_enum_write(struct stream_pos *pos, struct definition *definition) +int ctf_enum_write(struct bt_stream_pos *pos, struct definition *definition) { struct definition_enum *enum_definition = container_of(definition, struct definition_enum, p); diff --git a/formats/ctf/types/float.c b/formats/ctf/types/float.c index 2dfef86..f46e26a 100644 --- a/formats/ctf/types/float.c +++ b/formats/ctf/types/float.c @@ -96,9 +96,9 @@ static void float_unlock(void) assert(!ret); } -static int _ctf_float_copy(struct stream_pos *destp, +static int _ctf_float_copy(struct bt_stream_pos *destp, struct definition_float *dest_definition, - struct stream_pos *srcp, + struct bt_stream_pos *srcp, const struct definition_float *src_definition) { int ret; @@ -165,7 +165,7 @@ static int _ctf_float_copy(struct stream_pos *destp, return 0; } -int ctf_float_read(struct stream_pos *ppos, struct definition *definition) +int ctf_float_read(struct bt_stream_pos *ppos, struct definition *definition) { struct definition_float *float_definition = container_of(definition, struct definition_float, p); @@ -222,7 +222,7 @@ end: return ret; } -int ctf_float_write(struct stream_pos *ppos, struct definition *definition) +int ctf_float_write(struct bt_stream_pos *ppos, struct definition *definition) { struct definition_float *float_definition = container_of(definition, struct definition_float, p); diff --git a/formats/ctf/types/integer.c b/formats/ctf/types/integer.c index 66036ae..1267925 100644 --- a/formats/ctf/types/integer.c +++ b/formats/ctf/types/integer.c @@ -39,7 +39,7 @@ */ static -int _aligned_integer_read(struct stream_pos *ppos, +int _aligned_integer_read(struct bt_stream_pos *ppos, struct definition *definition) { struct definition_integer *integer_definition = @@ -141,7 +141,7 @@ int _aligned_integer_read(struct stream_pos *ppos, } static -int _aligned_integer_write(struct stream_pos *ppos, +int _aligned_integer_write(struct bt_stream_pos *ppos, struct definition *definition) { struct definition_integer *integer_definition = @@ -211,7 +211,7 @@ end: return 0; } -int ctf_integer_read(struct stream_pos *ppos, struct definition *definition) +int ctf_integer_read(struct bt_stream_pos *ppos, struct definition *definition) { struct definition_integer *integer_definition = container_of(definition, struct definition_integer, p); @@ -256,7 +256,7 @@ int ctf_integer_read(struct stream_pos *ppos, struct definition *definition) return 0; } -int ctf_integer_write(struct stream_pos *ppos, struct definition *definition) +int ctf_integer_write(struct bt_stream_pos *ppos, struct definition *definition) { struct definition_integer *integer_definition = container_of(definition, struct definition_integer, p); diff --git a/formats/ctf/types/sequence.c b/formats/ctf/types/sequence.c index 2ff31b7..b2221ea 100644 --- a/formats/ctf/types/sequence.c +++ b/formats/ctf/types/sequence.c @@ -28,7 +28,7 @@ #include -int ctf_sequence_read(struct stream_pos *ppos, struct definition *definition) +int ctf_sequence_read(struct bt_stream_pos *ppos, struct definition *definition) { struct definition_sequence *sequence_definition = container_of(definition, struct definition_sequence, p); @@ -63,7 +63,7 @@ int ctf_sequence_read(struct stream_pos *ppos, struct definition *definition) return bt_sequence_rw(ppos, definition); } -int ctf_sequence_write(struct stream_pos *ppos, struct definition *definition) +int ctf_sequence_write(struct bt_stream_pos *ppos, struct definition *definition) { struct definition_sequence *sequence_definition = container_of(definition, struct definition_sequence, p); diff --git a/formats/ctf/types/string.c b/formats/ctf/types/string.c index 357e273..5771733 100644 --- a/formats/ctf/types/string.c +++ b/formats/ctf/types/string.c @@ -31,7 +31,7 @@ #include /* C99 limits */ #include -int ctf_string_read(struct stream_pos *ppos, struct definition *definition) +int ctf_string_read(struct bt_stream_pos *ppos, struct definition *definition) { struct definition_string *string_definition = container_of(definition, struct definition_string, p); @@ -68,7 +68,7 @@ int ctf_string_read(struct stream_pos *ppos, struct definition *definition) return 0; } -int ctf_string_write(struct stream_pos *ppos, +int ctf_string_write(struct bt_stream_pos *ppos, struct definition *definition) { struct definition_string *string_definition = diff --git a/formats/ctf/types/struct.c b/formats/ctf/types/struct.c index b0d9e4a..7c1562b 100644 --- a/formats/ctf/types/struct.c +++ b/formats/ctf/types/struct.c @@ -28,7 +28,7 @@ #include -int ctf_struct_rw(struct stream_pos *ppos, struct definition *definition) +int ctf_struct_rw(struct bt_stream_pos *ppos, struct definition *definition) { struct declaration *declaration = definition->declaration; struct ctf_stream_pos *pos = ctf_pos(ppos); diff --git a/formats/ctf/types/variant.c b/formats/ctf/types/variant.c index f3559f5..3c0c371 100644 --- a/formats/ctf/types/variant.c +++ b/formats/ctf/types/variant.c @@ -28,7 +28,7 @@ #include -int ctf_variant_rw(struct stream_pos *ppos, struct definition *definition) +int ctf_variant_rw(struct bt_stream_pos *ppos, struct definition *definition) { struct declaration *declaration = definition->declaration; struct ctf_stream_pos *pos = ctf_pos(ppos); diff --git a/include/babeltrace/context.h b/include/babeltrace/context.h index f29ccf0..f3763e1 100644 --- a/include/babeltrace/context.h +++ b/include/babeltrace/context.h @@ -40,7 +40,7 @@ extern "C" { /* struct bt_context is opaque to the user */ struct bt_context; -struct stream_pos; +struct bt_stream_pos; struct bt_ctf_event; /* @@ -82,7 +82,7 @@ struct bt_context *bt_context_create(void); */ int bt_context_add_trace(struct bt_context *ctx, const char *path, const char *format, - void (*packet_seek)(struct stream_pos *pos, + void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence), struct mmap_stream_list *stream_list, FILE *metadata); diff --git a/include/babeltrace/ctf-text/types.h b/include/babeltrace/ctf-text/types.h index debecfe..8681f39 100644 --- a/include/babeltrace/ctf-text/types.h +++ b/include/babeltrace/ctf-text/types.h @@ -37,10 +37,10 @@ #include /* - * Inherit from both struct stream_pos and struct trace_descriptor. + * Inherit from both struct bt_stream_pos and struct trace_descriptor. */ struct ctf_text_stream_pos { - struct stream_pos parent; + struct bt_stream_pos parent; struct trace_descriptor trace_descriptor; FILE *fp; /* File pointer. NULL if unset. */ int depth; @@ -53,7 +53,7 @@ struct ctf_text_stream_pos { }; static inline -struct ctf_text_stream_pos *ctf_text_pos(struct stream_pos *pos) +struct ctf_text_stream_pos *ctf_text_pos(struct bt_stream_pos *pos) { return container_of(pos, struct ctf_text_stream_pos, parent); } @@ -62,21 +62,21 @@ struct ctf_text_stream_pos *ctf_text_pos(struct stream_pos *pos) * Write only is supported for now. */ BT_HIDDEN -int ctf_text_integer_write(struct stream_pos *pos, struct definition *definition); +int ctf_text_integer_write(struct bt_stream_pos *pos, struct definition *definition); BT_HIDDEN -int ctf_text_float_write(struct stream_pos *pos, struct definition *definition); +int ctf_text_float_write(struct bt_stream_pos *pos, struct definition *definition); BT_HIDDEN -int ctf_text_string_write(struct stream_pos *pos, struct definition *definition); +int ctf_text_string_write(struct bt_stream_pos *pos, struct definition *definition); BT_HIDDEN -int ctf_text_enum_write(struct stream_pos *pos, struct definition *definition); +int ctf_text_enum_write(struct bt_stream_pos *pos, struct definition *definition); BT_HIDDEN -int ctf_text_struct_write(struct stream_pos *pos, struct definition *definition); +int ctf_text_struct_write(struct bt_stream_pos *pos, struct definition *definition); BT_HIDDEN -int ctf_text_variant_write(struct stream_pos *pos, struct definition *definition); +int ctf_text_variant_write(struct bt_stream_pos *pos, struct definition *definition); BT_HIDDEN -int ctf_text_array_write(struct stream_pos *pos, struct definition *definition); +int ctf_text_array_write(struct bt_stream_pos *pos, struct definition *definition); BT_HIDDEN -int ctf_text_sequence_write(struct stream_pos *pos, struct definition *definition); +int ctf_text_sequence_write(struct bt_stream_pos *pos, struct definition *definition); static inline void print_pos_tabs(struct ctf_text_stream_pos *pos) diff --git a/include/babeltrace/ctf/types.h b/include/babeltrace/ctf/types.h index 8bd0102..f7b93d3 100644 --- a/include/babeltrace/ctf/types.h +++ b/include/babeltrace/ctf/types.h @@ -59,7 +59,7 @@ struct packet_index { * Always update ctf_stream_pos with ctf_move_pos and ctf_init_pos. */ struct ctf_stream_pos { - struct stream_pos parent; + struct bt_stream_pos parent; int fd; /* backing file fd. -1 if unset. */ GArray *packet_cycles_index; /* contains struct packet_index in cycles */ GArray *packet_real_index; /* contains struct packet_index in ns */ @@ -77,7 +77,7 @@ struct ctf_stream_pos { int64_t last_offset; /* offset before the last read_event */ uint64_t cur_index; /* current index in packet index */ uint64_t last_events_discarded; /* last known amount of event discarded */ - void (*packet_seek)(struct stream_pos *pos, size_t index, + void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence); /* function called to switch packet */ int dummy; /* dummy position, for length calculation */ @@ -85,41 +85,41 @@ struct ctf_stream_pos { }; static inline -struct ctf_stream_pos *ctf_pos(struct stream_pos *pos) +struct ctf_stream_pos *ctf_pos(struct bt_stream_pos *pos) { return container_of(pos, struct ctf_stream_pos, parent); } BT_HIDDEN -int ctf_integer_read(struct stream_pos *pos, struct definition *definition); +int ctf_integer_read(struct bt_stream_pos *pos, struct definition *definition); BT_HIDDEN -int ctf_integer_write(struct stream_pos *pos, struct definition *definition); +int ctf_integer_write(struct bt_stream_pos *pos, struct definition *definition); BT_HIDDEN -int ctf_float_read(struct stream_pos *pos, struct definition *definition); +int ctf_float_read(struct bt_stream_pos *pos, struct definition *definition); BT_HIDDEN -int ctf_float_write(struct stream_pos *pos, struct definition *definition); +int ctf_float_write(struct bt_stream_pos *pos, struct definition *definition); BT_HIDDEN -int ctf_string_read(struct stream_pos *pos, struct definition *definition); +int ctf_string_read(struct bt_stream_pos *pos, struct definition *definition); BT_HIDDEN -int ctf_string_write(struct stream_pos *pos, struct definition *definition); +int ctf_string_write(struct bt_stream_pos *pos, struct definition *definition); BT_HIDDEN -int ctf_enum_read(struct stream_pos *pos, struct definition *definition); +int ctf_enum_read(struct bt_stream_pos *pos, struct definition *definition); BT_HIDDEN -int ctf_enum_write(struct stream_pos *pos, struct definition *definition); +int ctf_enum_write(struct bt_stream_pos *pos, struct definition *definition); BT_HIDDEN -int ctf_struct_rw(struct stream_pos *pos, struct definition *definition); +int ctf_struct_rw(struct bt_stream_pos *pos, struct definition *definition); BT_HIDDEN -int ctf_variant_rw(struct stream_pos *pos, struct definition *definition); +int ctf_variant_rw(struct bt_stream_pos *pos, struct definition *definition); BT_HIDDEN -int ctf_array_read(struct stream_pos *pos, struct definition *definition); +int ctf_array_read(struct bt_stream_pos *pos, struct definition *definition); BT_HIDDEN -int ctf_array_write(struct stream_pos *pos, struct definition *definition); +int ctf_array_write(struct bt_stream_pos *pos, struct definition *definition); BT_HIDDEN -int ctf_sequence_read(struct stream_pos *pos, struct definition *definition); +int ctf_sequence_read(struct bt_stream_pos *pos, struct definition *definition); BT_HIDDEN -int ctf_sequence_write(struct stream_pos *pos, struct definition *definition); +int ctf_sequence_write(struct bt_stream_pos *pos, struct definition *definition); -void ctf_packet_seek(struct stream_pos *pos, size_t index, int whence); +void ctf_packet_seek(struct bt_stream_pos *pos, size_t index, int whence); int ctf_init_pos(struct ctf_stream_pos *pos, int fd, int open_flags); int ctf_fini_pos(struct ctf_stream_pos *pos); diff --git a/include/babeltrace/format.h b/include/babeltrace/format.h index c6faca7..fa0e325 100644 --- a/include/babeltrace/format.h +++ b/include/babeltrace/format.h @@ -41,7 +41,7 @@ extern "C" { typedef int bt_intern_str; /* forward declaration */ -struct stream_pos; +struct bt_stream_pos; struct bt_context; struct bt_trace_handle; @@ -62,12 +62,12 @@ struct format { bt_intern_str name; struct trace_descriptor *(*open_trace)(const char *path, int flags, - void (*packet_seek)(struct stream_pos *pos, + void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence), FILE *metadata_fp); struct trace_descriptor *(*open_mmap_trace)( struct mmap_stream_list *mmap_list, - void (*packet_seek)(struct stream_pos *pos, + void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence), FILE *metadata_fp); int (*close_trace)(struct trace_descriptor *descriptor); diff --git a/include/babeltrace/types.h b/include/babeltrace/types.h index d742b40..310a269 100644 --- a/include/babeltrace/types.h +++ b/include/babeltrace/types.h @@ -43,7 +43,7 @@ #define DEFAULT_NR_STRUCT_FIELDS 8 struct ctf_stream_definition; -struct stream_pos; +struct bt_stream_pos; struct format; struct definition; struct ctf_clock; @@ -106,19 +106,19 @@ struct definition { struct definition_scope *scope; }; -typedef int (*rw_dispatch)(struct stream_pos *pos, +typedef int (*rw_dispatch)(struct bt_stream_pos *pos, struct definition *definition); /* Parent of per-plugin positions */ -struct stream_pos { +struct bt_stream_pos { /* read/write dispatch table. Specific to plugin used for stream. */ rw_dispatch *rw_table; /* rw dispatch table */ - int (*event_cb)(struct stream_pos *pos, + int (*event_cb)(struct bt_stream_pos *pos, struct ctf_stream_definition *stream); }; static inline -int generic_rw(struct stream_pos *pos, struct definition *definition) +int generic_rw(struct bt_stream_pos *pos, struct definition *definition) { enum ctf_type_id dispatch_id = definition->declaration->id; rw_dispatch call; @@ -450,7 +450,7 @@ bt_struct_declaration_get_field_from_index(struct declaration_struct *struct_dec struct definition * bt_struct_definition_get_field_from_index(struct definition_struct *struct_definition, int index); -int bt_struct_rw(struct stream_pos *pos, struct definition *definition); +int bt_struct_rw(struct bt_stream_pos *pos, struct definition *definition); uint64_t bt_struct_declaration_len(struct declaration_struct *struct_declaration); /* @@ -480,7 +480,7 @@ int variant_definition_set_tag(struct definition_variant *variant, * to. */ struct definition *bt_variant_get_current_field(struct definition_variant *variant); -int bt_variant_rw(struct stream_pos *pos, struct definition *definition); +int bt_variant_rw(struct bt_stream_pos *pos, struct definition *definition); /* * elem_declaration passed as parameter now belongs to the array. No @@ -492,7 +492,7 @@ struct declaration_array * struct declaration_scope *parent_scope); uint64_t bt_array_len(struct definition_array *array); struct definition *bt_array_index(struct definition_array *array, uint64_t i); -int bt_array_rw(struct stream_pos *pos, struct definition *definition); +int bt_array_rw(struct bt_stream_pos *pos, struct definition *definition); GString *bt_get_char_array(const struct definition *field); int bt_get_array_len(const struct definition *field); @@ -506,7 +506,7 @@ struct declaration_sequence * struct declaration_scope *parent_scope); uint64_t bt_sequence_len(struct definition_sequence *sequence); struct definition *bt_sequence_index(struct definition_sequence *sequence, uint64_t i); -int bt_sequence_rw(struct stream_pos *pos, struct definition *definition); +int bt_sequence_rw(struct bt_stream_pos *pos, struct definition *definition); /* * in: path (dot separated), out: q (GArray of GQuark) diff --git a/lib/context.c b/lib/context.c index b728298..18e2e22 100644 --- a/lib/context.c +++ b/lib/context.c @@ -67,7 +67,7 @@ struct bt_context *bt_context_create(void) int bt_context_add_trace(struct bt_context *ctx, const char *path, const char *format_name, - void (*packet_seek)(struct stream_pos *pos, size_t index, + void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence), struct mmap_stream_list *stream_list, FILE *metadata) diff --git a/types/array.c b/types/array.c index 30699b1..43decb5 100644 --- a/types/array.c +++ b/types/array.c @@ -38,7 +38,7 @@ struct definition *_array_definition_new(struct declaration *declaration, static void _array_definition_free(struct definition *definition); -int bt_array_rw(struct stream_pos *pos, struct definition *definition) +int bt_array_rw(struct bt_stream_pos *pos, struct definition *definition) { struct definition_array *array_definition = container_of(definition, struct definition_array, p); diff --git a/types/sequence.c b/types/sequence.c index 2646cef..a91a249 100644 --- a/types/sequence.c +++ b/types/sequence.c @@ -39,7 +39,7 @@ struct definition *_sequence_definition_new(struct declaration *declaration, static void _sequence_definition_free(struct definition *definition); -int bt_sequence_rw(struct stream_pos *pos, struct definition *definition) +int bt_sequence_rw(struct bt_stream_pos *pos, struct definition *definition) { struct definition_sequence *sequence_definition = container_of(definition, struct definition_sequence, p); diff --git a/types/struct.c b/types/struct.c index 5da9033..219d523 100644 --- a/types/struct.c +++ b/types/struct.c @@ -43,7 +43,7 @@ struct definition *_struct_definition_new(struct declaration *declaration, static void _struct_definition_free(struct definition *definition); -int bt_struct_rw(struct stream_pos *ppos, struct definition *definition) +int bt_struct_rw(struct bt_stream_pos *ppos, struct definition *definition) { struct definition_struct *struct_definition = container_of(definition, struct definition_struct, p); diff --git a/types/variant.c b/types/variant.c index ebaf43c..4db0de9 100644 --- a/types/variant.c +++ b/types/variant.c @@ -39,7 +39,7 @@ struct definition *_variant_definition_new(struct declaration *declaration, static void _variant_definition_free(struct definition *definition); -int bt_variant_rw(struct stream_pos *ppos, struct definition *definition) +int bt_variant_rw(struct bt_stream_pos *ppos, struct definition *definition) { struct definition_variant *variant_definition = container_of(definition, struct definition_variant, p); -- 1.7.10.4 From jdesfossez at efficios.com Fri Feb 15 12:22:52 2013 From: jdesfossez at efficios.com (Julien Desfossez) Date: Fri, 15 Feb 2013 12:22:52 -0500 Subject: [lttng-dev] [BABELTRACE PATCH 3/7] Namespace the struct trace_descriptor In-Reply-To: <1360948976-14999-1-git-send-email-jdesfossez@efficios.com> References: <1360948976-14999-1-git-send-email-jdesfossez@efficios.com> Message-ID: <1360948976-14999-3-git-send-email-jdesfossez@efficios.com> This struct is exposed in the public API so we need to namespace it. Signed-off-by: Julien Desfossez --- converter/babeltrace.c | 4 ++-- formats/bt-dummy/bt-dummy.c | 4 ++-- formats/ctf-text/ctf-text.c | 8 +++---- formats/ctf/callbacks.c | 2 +- formats/ctf/ctf.c | 32 ++++++++++++++-------------- formats/ctf/events.c | 2 +- include/babeltrace/babeltrace-internal.h | 4 ++-- include/babeltrace/ctf-ir/metadata.h | 2 +- include/babeltrace/ctf-text/types.h | 4 ++-- include/babeltrace/format.h | 18 ++++++++-------- include/babeltrace/trace-collection.h | 4 ++-- include/babeltrace/trace-handle-internal.h | 2 +- lib/context.c | 2 +- lib/iterator.c | 8 +++---- lib/trace-collection.c | 4 ++-- 15 files changed, 50 insertions(+), 50 deletions(-) diff --git a/converter/babeltrace.c b/converter/babeltrace.c index b1f32c9..ef5016e 100644 --- a/converter/babeltrace.c +++ b/converter/babeltrace.c @@ -516,7 +516,7 @@ int bt_context_add_traces_recursive(struct bt_context *ctx, const char *path, return ret; } -int convert_trace(struct trace_descriptor *td_write, +int convert_trace(struct bt_trace_descriptor *td_write, struct bt_context *ctx) { struct bt_ctf_iter *iter; @@ -556,7 +556,7 @@ int main(int argc, char **argv) { int ret, partial_error = 0, open_success = 0; struct format *fmt_write; - struct trace_descriptor *td_write; + struct bt_trace_descriptor *td_write; struct bt_context *ctx; int i; diff --git a/formats/bt-dummy/bt-dummy.c b/formats/bt-dummy/bt-dummy.c index 537e6bb..f0ce913 100644 --- a/formats/bt-dummy/bt-dummy.c +++ b/formats/bt-dummy/bt-dummy.c @@ -45,7 +45,7 @@ int bt_dummy_write_event(struct bt_stream_pos *ppos, struct ctf_stream_definitio } static -struct trace_descriptor *bt_dummy_open_trace(const char *path, int flags, +struct bt_trace_descriptor *bt_dummy_open_trace(const char *path, int flags, void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence), FILE *metadata_fp) { @@ -58,7 +58,7 @@ struct trace_descriptor *bt_dummy_open_trace(const char *path, int flags, } static -int bt_dummy_close_trace(struct trace_descriptor *td) +int bt_dummy_close_trace(struct bt_trace_descriptor *td) { struct ctf_text_stream_pos *pos = container_of(td, struct ctf_text_stream_pos, diff --git a/formats/ctf-text/ctf-text.c b/formats/ctf-text/ctf-text.c index 1f798b2..7188658 100644 --- a/formats/ctf-text/ctf-text.c +++ b/formats/ctf-text/ctf-text.c @@ -87,11 +87,11 @@ enum bt_loglevel { }; static -struct trace_descriptor *ctf_text_open_trace(const char *path, int flags, +struct bt_trace_descriptor *ctf_text_open_trace(const char *path, int flags, void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence), FILE *metadata_fp); static -int ctf_text_close_trace(struct trace_descriptor *descriptor); +int ctf_text_close_trace(struct bt_trace_descriptor *descriptor); static rw_dispatch write_dispatch_table[] = { @@ -555,7 +555,7 @@ error: } static -struct trace_descriptor *ctf_text_open_trace(const char *path, int flags, +struct bt_trace_descriptor *ctf_text_open_trace(const char *path, int flags, void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence), FILE *metadata_fp) { @@ -592,7 +592,7 @@ error: } static -int ctf_text_close_trace(struct trace_descriptor *td) +int ctf_text_close_trace(struct bt_trace_descriptor *td) { int ret; struct ctf_text_stream_pos *pos = diff --git a/formats/ctf/callbacks.c b/formats/ctf/callbacks.c index 793f3d3..3595532 100644 --- a/formats/ctf/callbacks.c +++ b/formats/ctf/callbacks.c @@ -89,7 +89,7 @@ int bt_ctf_iter_add_callback(struct bt_ctf_iter *iter, tc = iter->parent.ctx->tc; for (i = 0; i < tc->array->len; i++) { struct ctf_trace *tin; - struct trace_descriptor *td_read; + struct bt_trace_descriptor *td_read; td_read = g_ptr_array_index(tc->array, i); tin = container_of(td_read, struct ctf_trace, parent); diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index c6b148c..2411f7f 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -76,33 +76,33 @@ uint64_t opt_clock_offset; extern int yydebug; static -struct trace_descriptor *ctf_open_trace(const char *path, int flags, +struct bt_trace_descriptor *ctf_open_trace(const char *path, int flags, void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence), FILE *metadata_fp); static -struct trace_descriptor *ctf_open_mmap_trace( +struct bt_trace_descriptor *ctf_open_mmap_trace( struct mmap_stream_list *mmap_list, void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence), FILE *metadata_fp); static -void ctf_set_context(struct trace_descriptor *descriptor, +void ctf_set_context(struct bt_trace_descriptor *descriptor, struct bt_context *ctx); static -void ctf_set_handle(struct trace_descriptor *descriptor, +void ctf_set_handle(struct bt_trace_descriptor *descriptor, struct bt_trace_handle *handle); static -int ctf_close_trace(struct trace_descriptor *descriptor); +int ctf_close_trace(struct bt_trace_descriptor *descriptor); static -uint64_t ctf_timestamp_begin(struct trace_descriptor *descriptor, +uint64_t ctf_timestamp_begin(struct bt_trace_descriptor *descriptor, struct bt_trace_handle *handle, enum bt_clock_type type); static -uint64_t ctf_timestamp_end(struct trace_descriptor *descriptor, +uint64_t ctf_timestamp_end(struct bt_trace_descriptor *descriptor, struct bt_trace_handle *handle, enum bt_clock_type type); static -int ctf_convert_index_timestamp(struct trace_descriptor *tdp); +int ctf_convert_index_timestamp(struct bt_trace_descriptor *tdp); static rw_dispatch read_dispatch_table[] = { @@ -141,7 +141,7 @@ struct format ctf_format = { }; static -uint64_t ctf_timestamp_begin(struct trace_descriptor *descriptor, +uint64_t ctf_timestamp_begin(struct bt_trace_descriptor *descriptor, struct bt_trace_handle *handle, enum bt_clock_type type) { struct ctf_trace *tin; @@ -202,7 +202,7 @@ error: } static -uint64_t ctf_timestamp_end(struct trace_descriptor *descriptor, +uint64_t ctf_timestamp_end(struct bt_trace_descriptor *descriptor, struct bt_trace_handle *handle, enum bt_clock_type type) { struct ctf_trace *tin; @@ -1695,7 +1695,7 @@ error: * since the index creation read it entirely. */ static -struct trace_descriptor *ctf_open_trace(const char *path, int flags, +struct bt_trace_descriptor *ctf_open_trace(const char *path, int flags, void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence), FILE *metadata_fp) { @@ -1859,7 +1859,7 @@ error: } static -struct trace_descriptor *ctf_open_mmap_trace( +struct bt_trace_descriptor *ctf_open_mmap_trace( struct mmap_stream_list *mmap_list, void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence), @@ -1891,7 +1891,7 @@ error: } static -int ctf_convert_index_timestamp(struct trace_descriptor *tdp) +int ctf_convert_index_timestamp(struct bt_trace_descriptor *tdp) { int i, j, k; struct ctf_trace *td = container_of(tdp, struct ctf_trace, parent); @@ -1959,7 +1959,7 @@ int ctf_close_file_stream(struct ctf_file_stream *file_stream) } static -int ctf_close_trace(struct trace_descriptor *tdp) +int ctf_close_trace(struct bt_trace_descriptor *tdp) { struct ctf_trace *td = container_of(tdp, struct ctf_trace, parent); int ret; @@ -2000,7 +2000,7 @@ int ctf_close_trace(struct trace_descriptor *tdp) } static -void ctf_set_context(struct trace_descriptor *descriptor, +void ctf_set_context(struct bt_trace_descriptor *descriptor, struct bt_context *ctx) { struct ctf_trace *td = container_of(descriptor, struct ctf_trace, @@ -2010,7 +2010,7 @@ void ctf_set_context(struct trace_descriptor *descriptor, } static -void ctf_set_handle(struct trace_descriptor *descriptor, +void ctf_set_handle(struct bt_trace_descriptor *descriptor, struct bt_trace_handle *handle) { struct ctf_trace *td = container_of(descriptor, struct ctf_trace, diff --git a/formats/ctf/events.c b/formats/ctf/events.c index ff0fcb3..d9460b1 100644 --- a/formats/ctf/events.c +++ b/formats/ctf/events.c @@ -613,7 +613,7 @@ int bt_ctf_get_event_decl_list(int handle_id, struct bt_context *ctx, unsigned int *count) { struct bt_trace_handle *handle; - struct trace_descriptor *td; + struct bt_trace_descriptor *td; struct ctf_trace *tin; if (!ctx || !list || !count) diff --git a/include/babeltrace/babeltrace-internal.h b/include/babeltrace/babeltrace-internal.h index 6b6fcec..6219b3a 100644 --- a/include/babeltrace/babeltrace-internal.h +++ b/include/babeltrace/babeltrace-internal.h @@ -50,9 +50,9 @@ extern int babeltrace_verbose, babeltrace_debug; */ #define BT_HIDDEN __attribute__((visibility("hidden"))) -struct trace_descriptor; +struct bt_trace_descriptor; struct trace_collection { - GPtrArray *array; /* struct trace_descriptor */ + GPtrArray *array; /* struct bt_trace_descriptor */ GHashTable *clocks; /* struct ctf_clock */ uint64_t single_clock_offset_avg; diff --git a/include/babeltrace/ctf-ir/metadata.h b/include/babeltrace/ctf-ir/metadata.h index b209993..04e8945 100644 --- a/include/babeltrace/ctf-ir/metadata.h +++ b/include/babeltrace/ctf-ir/metadata.h @@ -174,7 +174,7 @@ struct ctf_tracer_env { }; struct ctf_trace { - struct trace_descriptor parent; + struct bt_trace_descriptor parent; /* root scope */ struct declaration_scope *root_declaration_scope; diff --git a/include/babeltrace/ctf-text/types.h b/include/babeltrace/ctf-text/types.h index 8681f39..15c8333 100644 --- a/include/babeltrace/ctf-text/types.h +++ b/include/babeltrace/ctf-text/types.h @@ -37,11 +37,11 @@ #include /* - * Inherit from both struct bt_stream_pos and struct trace_descriptor. + * Inherit from both struct bt_stream_pos and struct bt_trace_descriptor. */ struct ctf_text_stream_pos { struct bt_stream_pos parent; - struct trace_descriptor trace_descriptor; + struct bt_trace_descriptor trace_descriptor; FILE *fp; /* File pointer. NULL if unset. */ int depth; int dummy; /* disable output */ diff --git a/include/babeltrace/format.h b/include/babeltrace/format.h index fa0e325..d0f9378 100644 --- a/include/babeltrace/format.h +++ b/include/babeltrace/format.h @@ -46,7 +46,7 @@ struct bt_context; struct bt_trace_handle; /* Parent trace descriptor */ -struct trace_descriptor { +struct bt_trace_descriptor { }; struct mmap_stream { @@ -61,25 +61,25 @@ struct mmap_stream_list { struct format { bt_intern_str name; - struct trace_descriptor *(*open_trace)(const char *path, int flags, + struct bt_trace_descriptor *(*open_trace)(const char *path, int flags, void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence), FILE *metadata_fp); - struct trace_descriptor *(*open_mmap_trace)( + struct bt_trace_descriptor *(*open_mmap_trace)( struct mmap_stream_list *mmap_list, void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence), FILE *metadata_fp); - int (*close_trace)(struct trace_descriptor *descriptor); - void (*set_context)(struct trace_descriptor *descriptor, + int (*close_trace)(struct bt_trace_descriptor *descriptor); + void (*set_context)(struct bt_trace_descriptor *descriptor, struct bt_context *ctx); - void (*set_handle)(struct trace_descriptor *descriptor, + void (*set_handle)(struct bt_trace_descriptor *descriptor, struct bt_trace_handle *handle); - uint64_t (*timestamp_begin)(struct trace_descriptor *descriptor, + uint64_t (*timestamp_begin)(struct bt_trace_descriptor *descriptor, struct bt_trace_handle *handle, enum bt_clock_type type); - uint64_t (*timestamp_end)(struct trace_descriptor *descriptor, + uint64_t (*timestamp_end)(struct bt_trace_descriptor *descriptor, struct bt_trace_handle *handle, enum bt_clock_type type); - int (*convert_index_timestamp)(struct trace_descriptor *descriptor); + int (*convert_index_timestamp)(struct bt_trace_descriptor *descriptor); }; extern struct format *bt_lookup_format(bt_intern_str qname); diff --git a/include/babeltrace/trace-collection.h b/include/babeltrace/trace-collection.h index e65654f..904a7d8 100644 --- a/include/babeltrace/trace-collection.h +++ b/include/babeltrace/trace-collection.h @@ -38,9 +38,9 @@ struct trace_collection; void bt_init_trace_collection(struct trace_collection *tc); void bt_finalize_trace_collection(struct trace_collection *tc); int bt_trace_collection_add(struct trace_collection *tc, - struct trace_descriptor *td); + struct bt_trace_descriptor *td); int bt_trace_collection_remove(struct trace_collection *tc, - struct trace_descriptor *td); + struct bt_trace_descriptor *td); #ifdef __cplusplus } diff --git a/include/babeltrace/trace-handle-internal.h b/include/babeltrace/trace-handle-internal.h index 2b5a5ae..f7e2b8a 100644 --- a/include/babeltrace/trace-handle-internal.h +++ b/include/babeltrace/trace-handle-internal.h @@ -43,7 +43,7 @@ */ struct bt_trace_handle { int id; - struct trace_descriptor *td; + struct bt_trace_descriptor *td; struct format *format; char path[PATH_MAX]; uint64_t real_timestamp_begin; diff --git a/lib/context.c b/lib/context.c index 18e2e22..e6b60fa 100644 --- a/lib/context.c +++ b/lib/context.c @@ -72,7 +72,7 @@ int bt_context_add_trace(struct bt_context *ctx, const char *path, struct mmap_stream_list *stream_list, FILE *metadata) { - struct trace_descriptor *td; + struct bt_trace_descriptor *td; struct format *fmt; struct bt_trace_handle *handle; int ret, closeret; diff --git a/lib/iterator.c b/lib/iterator.c index dc12a2f..4190e65 100644 --- a/lib/iterator.c +++ b/lib/iterator.c @@ -309,7 +309,7 @@ static int seek_last_ctf_trace_collection(struct trace_collection *tc, /* For each trace in the trace_collection */ for (i = 0; i < tc->array->len; i++) { struct ctf_trace *tin; - struct trace_descriptor *td_read; + struct bt_trace_descriptor *td_read; td_read = g_ptr_array_index(tc->array, i); if (!td_read) @@ -421,7 +421,7 @@ int bt_iter_set_pos(struct bt_iter *iter, const struct bt_iter_pos *iter_pos) /* for each trace in the trace_collection */ for (i = 0; i < tc->array->len; i++) { struct ctf_trace *tin; - struct trace_descriptor *td_read; + struct bt_trace_descriptor *td_read; td_read = g_ptr_array_index(tc->array, i); if (!td_read) @@ -451,7 +451,7 @@ int bt_iter_set_pos(struct bt_iter *iter, const struct bt_iter_pos *iter_pos) for (i = 0; i < tc->array->len; i++) { struct ctf_trace *tin; - struct trace_descriptor *td_read; + struct bt_trace_descriptor *td_read; int stream_id; td_read = g_ptr_array_index(tc->array, i); @@ -675,7 +675,7 @@ int bt_iter_init(struct bt_iter *iter, for (i = 0; i < ctx->tc->array->len; i++) { struct ctf_trace *tin; - struct trace_descriptor *td_read; + struct bt_trace_descriptor *td_read; td_read = g_ptr_array_index(ctx->tc->array, i); if (!td_read) diff --git a/lib/trace-collection.c b/lib/trace-collection.c index fc06dcd..608a6e4 100644 --- a/lib/trace-collection.c +++ b/lib/trace-collection.c @@ -156,7 +156,7 @@ static void clock_add(gpointer key, gpointer value, gpointer user_data) * convert the index from cycles to real time. */ int bt_trace_collection_add(struct trace_collection *tc, - struct trace_descriptor *td) + struct bt_trace_descriptor *td) { struct ctf_trace *trace; @@ -209,7 +209,7 @@ error: } int bt_trace_collection_remove(struct trace_collection *tc, - struct trace_descriptor *td) + struct bt_trace_descriptor *td) { if (!tc || !td) return -EINVAL; -- 1.7.10.4 From jdesfossez at efficios.com Fri Feb 15 12:22:53 2013 From: jdesfossez at efficios.com (Julien Desfossez) Date: Fri, 15 Feb 2013 12:22:53 -0500 Subject: [lttng-dev] [BABELTRACE PATCH 4/7] Namespace the struct mmap_stream In-Reply-To: <1360948976-14999-1-git-send-email-jdesfossez@efficios.com> References: <1360948976-14999-1-git-send-email-jdesfossez@efficios.com> Message-ID: <1360948976-14999-4-git-send-email-jdesfossez@efficios.com> This struct is exposed in the public API so we need to namespace it. Signed-off-by: Julien Desfossez --- formats/ctf/ctf.c | 12 ++++++------ include/babeltrace/context.h | 2 +- include/babeltrace/format.h | 6 +++--- lib/context.c | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index 2411f7f..3bd1cc1 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -82,7 +82,7 @@ struct bt_trace_descriptor *ctf_open_trace(const char *path, int flags, FILE *metadata_fp); static struct bt_trace_descriptor *ctf_open_mmap_trace( - struct mmap_stream_list *mmap_list, + struct bt_mmap_stream_list *mmap_list, void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence), FILE *metadata_fp); @@ -1736,7 +1736,7 @@ error: static void ctf_init_mmap_pos(struct ctf_stream_pos *pos, - struct mmap_stream *mmap_info) + struct bt_mmap_stream *mmap_info) { pos->mmap_offset = 0; pos->packet_size = 0; @@ -1785,7 +1785,7 @@ end: static int ctf_open_mmap_stream_read(struct ctf_trace *td, - struct mmap_stream *mmap_info, + struct bt_mmap_stream *mmap_info, void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence)) { @@ -1827,13 +1827,13 @@ error_def: static int ctf_open_mmap_trace_read(struct ctf_trace *td, - struct mmap_stream_list *mmap_list, + struct bt_mmap_stream_list *mmap_list, void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence), FILE *metadata_fp) { int ret; - struct mmap_stream *mmap_info; + struct bt_mmap_stream *mmap_info; ret = ctf_open_trace_metadata_read(td, ctf_packet_seek, metadata_fp); if (ret) { @@ -1860,7 +1860,7 @@ error: static struct bt_trace_descriptor *ctf_open_mmap_trace( - struct mmap_stream_list *mmap_list, + struct bt_mmap_stream_list *mmap_list, void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence), FILE *metadata_fp) diff --git a/include/babeltrace/context.h b/include/babeltrace/context.h index f3763e1..b28df09 100644 --- a/include/babeltrace/context.h +++ b/include/babeltrace/context.h @@ -84,7 +84,7 @@ int bt_context_add_trace(struct bt_context *ctx, const char *path, const char *format, void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence), - struct mmap_stream_list *stream_list, + struct bt_mmap_stream_list *stream_list, FILE *metadata); /* diff --git a/include/babeltrace/format.h b/include/babeltrace/format.h index d0f9378..8d4ac4b 100644 --- a/include/babeltrace/format.h +++ b/include/babeltrace/format.h @@ -49,12 +49,12 @@ struct bt_trace_handle; struct bt_trace_descriptor { }; -struct mmap_stream { +struct bt_mmap_stream { int fd; struct bt_list_head list; }; -struct mmap_stream_list { +struct bt_mmap_stream_list { struct bt_list_head head; }; @@ -66,7 +66,7 @@ struct format { size_t index, int whence), FILE *metadata_fp); struct bt_trace_descriptor *(*open_mmap_trace)( - struct mmap_stream_list *mmap_list, + struct bt_mmap_stream_list *mmap_list, void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence), FILE *metadata_fp); diff --git a/lib/context.c b/lib/context.c index e6b60fa..0040972 100644 --- a/lib/context.c +++ b/lib/context.c @@ -69,7 +69,7 @@ int bt_context_add_trace(struct bt_context *ctx, const char *path, const char *format_name, void (*packet_seek)(struct bt_stream_pos *pos, size_t index, int whence), - struct mmap_stream_list *stream_list, + struct bt_mmap_stream_list *stream_list, FILE *metadata) { struct bt_trace_descriptor *td; -- 1.7.10.4 From jdesfossez at efficios.com Fri Feb 15 12:22:54 2013 From: jdesfossez at efficios.com (Julien Desfossez) Date: Fri, 15 Feb 2013 12:22:54 -0500 Subject: [lttng-dev] [BABELTRACE PATCH 5/7] Namespace the struct format In-Reply-To: <1360948976-14999-1-git-send-email-jdesfossez@efficios.com> References: <1360948976-14999-1-git-send-email-jdesfossez@efficios.com> Message-ID: <1360948976-14999-5-git-send-email-jdesfossez@efficios.com> This struct is exposed in the public API, we need to namespace it. Signed-off-by: Julien Desfossez --- converter/babeltrace.c | 4 ++-- formats/bt-dummy/bt-dummy.c | 2 +- formats/ctf-text/ctf-text.c | 2 +- formats/ctf/ctf.c | 2 +- include/babeltrace/format.h | 8 ++++---- include/babeltrace/trace-handle-internal.h | 2 +- include/babeltrace/types.h | 2 +- lib/context.c | 2 +- lib/registry.c | 6 +++--- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/converter/babeltrace.c b/converter/babeltrace.c index ef5016e..20ded00 100644 --- a/converter/babeltrace.c +++ b/converter/babeltrace.c @@ -68,7 +68,7 @@ static char *opt_input_format, *opt_output_format; static GPtrArray *opt_input_paths; static char *opt_output_path; -static struct format *fmt_read; +static struct bt_format *fmt_read; static void strlower(char *str) @@ -555,7 +555,7 @@ error_iter: int main(int argc, char **argv) { int ret, partial_error = 0, open_success = 0; - struct format *fmt_write; + struct bt_format *fmt_write; struct bt_trace_descriptor *td_write; struct bt_context *ctx; int i; diff --git a/formats/bt-dummy/bt-dummy.c b/formats/bt-dummy/bt-dummy.c index f0ce913..9fde1c9 100644 --- a/formats/bt-dummy/bt-dummy.c +++ b/formats/bt-dummy/bt-dummy.c @@ -68,7 +68,7 @@ int bt_dummy_close_trace(struct bt_trace_descriptor *td) } static -struct format bt_dummy_format = { +struct bt_format bt_dummy_format = { .open_trace = bt_dummy_open_trace, .close_trace = bt_dummy_close_trace, }; diff --git a/formats/ctf-text/ctf-text.c b/formats/ctf-text/ctf-text.c index 7188658..cd69125 100644 --- a/formats/ctf-text/ctf-text.c +++ b/formats/ctf-text/ctf-text.c @@ -106,7 +106,7 @@ rw_dispatch write_dispatch_table[] = { }; static -struct format ctf_text_format = { +struct bt_format ctf_text_format = { .open_trace = ctf_text_open_trace, .close_trace = ctf_text_close_trace, }; diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index 3bd1cc1..aea12a1 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -129,7 +129,7 @@ rw_dispatch write_dispatch_table[] = { }; static -struct format ctf_format = { +struct bt_format ctf_format = { .open_trace = ctf_open_trace, .open_mmap_trace = ctf_open_mmap_trace, .close_trace = ctf_close_trace, diff --git a/include/babeltrace/format.h b/include/babeltrace/format.h index 8d4ac4b..f1f8763 100644 --- a/include/babeltrace/format.h +++ b/include/babeltrace/format.h @@ -58,7 +58,7 @@ struct bt_mmap_stream_list { struct bt_list_head head; }; -struct format { +struct bt_format { bt_intern_str name; struct bt_trace_descriptor *(*open_trace)(const char *path, int flags, @@ -82,10 +82,10 @@ struct format { int (*convert_index_timestamp)(struct bt_trace_descriptor *descriptor); }; -extern struct format *bt_lookup_format(bt_intern_str qname); +extern struct bt_format *bt_lookup_format(bt_intern_str qname); extern void bt_fprintf_format_list(FILE *fp); -extern int bt_register_format(struct format *format); -extern void bt_unregister_format(struct format *format); +extern int bt_register_format(struct bt_format *format); +extern void bt_unregister_format(struct bt_format *format); #ifdef __cplusplus } diff --git a/include/babeltrace/trace-handle-internal.h b/include/babeltrace/trace-handle-internal.h index f7e2b8a..5e9c1c6 100644 --- a/include/babeltrace/trace-handle-internal.h +++ b/include/babeltrace/trace-handle-internal.h @@ -44,7 +44,7 @@ struct bt_trace_handle { int id; struct bt_trace_descriptor *td; - struct format *format; + struct bt_format *format; char path[PATH_MAX]; uint64_t real_timestamp_begin; uint64_t real_timestamp_end; diff --git a/include/babeltrace/types.h b/include/babeltrace/types.h index 310a269..093ef0c 100644 --- a/include/babeltrace/types.h +++ b/include/babeltrace/types.h @@ -44,7 +44,7 @@ struct ctf_stream_definition; struct bt_stream_pos; -struct format; +struct bt_format; struct definition; struct ctf_clock; diff --git a/lib/context.c b/lib/context.c index 0040972..209cfde 100644 --- a/lib/context.c +++ b/lib/context.c @@ -73,7 +73,7 @@ int bt_context_add_trace(struct bt_context *ctx, const char *path, FILE *metadata) { struct bt_trace_descriptor *td; - struct format *fmt; + struct bt_format *fmt; struct bt_trace_handle *handle; int ret, closeret; diff --git a/lib/registry.c b/lib/registry.c index 28af184..bdce0c6 100644 --- a/lib/registry.c +++ b/lib/registry.c @@ -67,7 +67,7 @@ void format_refcount_dec(void) format_cleanup(); } -struct format *bt_lookup_format(bt_intern_str name) +struct bt_format *bt_lookup_format(bt_intern_str name) { if (!init_done) return NULL; @@ -103,7 +103,7 @@ void bt_fprintf_format_list(FILE *fp) fprintf(fp, ".\n"); } -int bt_register_format(struct format *format) +int bt_register_format(struct bt_format *format) { if (!format) return -EINVAL; @@ -121,7 +121,7 @@ int bt_register_format(struct format *format) return 0; } -void bt_unregister_format(struct format *format) +void bt_unregister_format(struct bt_format *format) { assert(bt_lookup_format(format->name)); g_hash_table_remove(format_registry, -- 1.7.10.4 From jdesfossez at efficios.com Fri Feb 15 12:22:56 2013 From: jdesfossez at efficios.com (Julien Desfossez) Date: Fri, 15 Feb 2013 12:22:56 -0500 Subject: [lttng-dev] [BABELTRACE PATCH 7/7] Namespace the struct declaration In-Reply-To: <1360948976-14999-1-git-send-email-jdesfossez@efficios.com> References: <1360948976-14999-1-git-send-email-jdesfossez@efficios.com> Message-ID: <1360948976-14999-7-git-send-email-jdesfossez@efficios.com> This struct is exposed in the public API so we need to namespace it. Signed-off-by: Julien Desfossez --- formats/ctf-text/types/array.c | 2 +- formats/ctf-text/types/sequence.c | 2 +- formats/ctf-text/types/struct.c | 2 +- formats/ctf/events.c | 26 +++++----- .../ctf/metadata/ctf-visitor-generate-io-struct.c | 54 ++++++++++---------- formats/ctf/types/array.c | 4 +- formats/ctf/types/sequence.c | 4 +- formats/ctf/types/struct.c | 2 +- formats/ctf/types/variant.c | 2 +- include/babeltrace/ctf/events.h | 20 ++++---- include/babeltrace/types.h | 48 ++++++++--------- types/array.c | 12 ++--- types/enum.c | 6 +-- types/float.c | 8 +-- types/integer.c | 6 +-- types/sequence.c | 10 ++-- types/string.c | 6 +-- types/struct.c | 10 ++-- types/types.c | 12 ++--- types/variant.c | 14 ++--- 20 files changed, 125 insertions(+), 125 deletions(-) diff --git a/formats/ctf-text/types/array.c b/formats/ctf-text/types/array.c index d9f57a2..47eb128 100644 --- a/formats/ctf-text/types/array.c +++ b/formats/ctf-text/types/array.c @@ -36,7 +36,7 @@ int ctf_text_array_write(struct bt_stream_pos *ppos, struct bt_definition *defin container_of(definition, struct definition_array, p); struct declaration_array *array_declaration = array_definition->declaration; - struct declaration *elem = array_declaration->elem; + struct bt_declaration *elem = array_declaration->elem; int field_nr_saved; int ret = 0; diff --git a/formats/ctf-text/types/sequence.c b/formats/ctf-text/types/sequence.c index 706fe5e..a9499b4 100644 --- a/formats/ctf-text/types/sequence.c +++ b/formats/ctf-text/types/sequence.c @@ -36,7 +36,7 @@ int ctf_text_sequence_write(struct bt_stream_pos *ppos, struct bt_definition *de container_of(definition, struct definition_sequence, p); struct declaration_sequence *sequence_declaration = sequence_definition->declaration; - struct declaration *elem = sequence_declaration->elem; + struct bt_declaration *elem = sequence_declaration->elem; int field_nr_saved; int ret = 0; diff --git a/formats/ctf-text/types/struct.c b/formats/ctf-text/types/struct.c index 1b9e27e..cbfcc7c 100644 --- a/formats/ctf-text/types/struct.c +++ b/formats/ctf-text/types/struct.c @@ -31,7 +31,7 @@ int ctf_text_struct_write(struct bt_stream_pos *ppos, struct bt_definition *definition) { - struct declaration *declaration = definition->declaration; + struct bt_declaration *declaration = definition->declaration; struct declaration_struct *struct_declaration = container_of(declaration, struct declaration_struct, p); struct ctf_text_stream_pos *pos = ctf_text_pos(ppos); diff --git a/formats/ctf/events.c b/formats/ctf/events.c index af7f5e1..3cf3b88 100644 --- a/formats/ctf/events.c +++ b/formats/ctf/events.c @@ -174,7 +174,7 @@ const char *bt_ctf_field_name(const struct bt_definition *def) return rem_(g_quark_to_string(def->name)); } -enum ctf_type_id bt_ctf_field_type(const struct declaration *decl) +enum ctf_type_id bt_ctf_field_type(const struct bt_declaration *decl) { if (!decl) return CTF_TYPE_UNKNOWN; @@ -358,7 +358,7 @@ int bt_ctf_field_get_error(void) } static const struct declaration_integer * -get_declaration_integer(const struct declaration *decl) +get_declaration_integer(const struct bt_declaration *decl) { if (!decl || bt_ctf_field_type(decl) != CTF_TYPE_INTEGER) return NULL; @@ -366,7 +366,7 @@ get_declaration_integer(const struct declaration *decl) } static const struct declaration_string * -get_declaration_string(const struct declaration *decl) +get_declaration_string(const struct bt_declaration *decl) { if (!decl || bt_ctf_field_type(decl) != CTF_TYPE_STRING) return NULL; @@ -374,7 +374,7 @@ get_declaration_string(const struct declaration *decl) } static const struct declaration_array * -get_declaration_array(const struct declaration *decl) +get_declaration_array(const struct bt_declaration *decl) { if (!decl || bt_ctf_field_type(decl) != CTF_TYPE_ARRAY) return NULL; @@ -382,14 +382,14 @@ get_declaration_array(const struct declaration *decl) } static const struct declaration_sequence * -get_declaration_sequence(const struct declaration *decl) +get_declaration_sequence(const struct bt_declaration *decl) { if (!decl || bt_ctf_field_type(decl) != CTF_TYPE_SEQUENCE) return NULL; return container_of(decl, const struct declaration_sequence, p); } -int bt_ctf_get_int_signedness(const struct declaration *decl) +int bt_ctf_get_int_signedness(const struct bt_declaration *decl) { const struct declaration_integer *integer; @@ -401,7 +401,7 @@ int bt_ctf_get_int_signedness(const struct declaration *decl) return integer->signedness; } -int bt_ctf_get_int_base(const struct declaration *decl) +int bt_ctf_get_int_base(const struct bt_declaration *decl) { const struct declaration_integer *integer; @@ -413,7 +413,7 @@ int bt_ctf_get_int_base(const struct declaration *decl) return integer->base; } -int bt_ctf_get_int_byte_order(const struct declaration *decl) +int bt_ctf_get_int_byte_order(const struct bt_declaration *decl) { const struct declaration_integer *integer; @@ -425,7 +425,7 @@ int bt_ctf_get_int_byte_order(const struct declaration *decl) return integer->byte_order; } -ssize_t bt_ctf_get_int_len(const struct declaration *decl) +ssize_t bt_ctf_get_int_len(const struct bt_declaration *decl) { const struct declaration_integer *integer; @@ -485,7 +485,7 @@ const char *bt_ctf_get_enum_str(const struct bt_definition *field) return ret; } -enum ctf_string_encoding bt_ctf_get_encoding(const struct declaration *decl) +enum ctf_string_encoding bt_ctf_get_encoding(const struct bt_declaration *decl) { enum ctf_string_encoding ret = 0; enum ctf_type_id type; @@ -540,7 +540,7 @@ error: return -1; } -int bt_ctf_get_array_len(const struct declaration *decl) +int bt_ctf_get_array_len(const struct bt_declaration *decl) { const struct declaration_array *array; @@ -767,7 +767,7 @@ const char *bt_ctf_get_decl_field_name(const struct bt_ctf_field_decl *field) return rem_(g_quark_to_string(((struct declaration_field *) field)->name)); } -const struct declaration *bt_ctf_get_decl_from_def(const struct bt_definition *def) +const struct bt_declaration *bt_ctf_get_decl_from_def(const struct bt_definition *def) { if (def) return def->declaration; @@ -775,7 +775,7 @@ const struct declaration *bt_ctf_get_decl_from_def(const struct bt_definition *d return NULL; } -const struct declaration *bt_ctf_get_decl_from_field_decl( +const struct bt_declaration *bt_ctf_get_decl_from_field_decl( const struct bt_ctf_field_decl *field) { if (field) diff --git a/formats/ctf/metadata/ctf-visitor-generate-io-struct.c b/formats/ctf/metadata/ctf-visitor-generate-io-struct.c index ebf8b1b..4671d1b 100644 --- a/formats/ctf/metadata/ctf-visitor-generate-io-struct.c +++ b/formats/ctf/metadata/ctf-visitor-generate-io-struct.c @@ -58,7 +58,7 @@ struct last_enum_value { int opt_clock_force_correlate; static -struct declaration *ctf_type_specifier_list_visit(FILE *fd, +struct bt_declaration *ctf_type_specifier_list_visit(FILE *fd, int depth, struct ctf_node *type_specifier_list, struct declaration_scope *declaration_scope, struct ctf_trace *trace); @@ -411,12 +411,12 @@ GQuark create_typealias_identifier(FILE *fd, int depth, } static -struct declaration *ctf_type_declarator_visit(FILE *fd, int depth, +struct bt_declaration *ctf_type_declarator_visit(FILE *fd, int depth, struct ctf_node *type_specifier_list, GQuark *field_name, struct ctf_node *node_type_declarator, struct declaration_scope *declaration_scope, - struct declaration *nested_declaration, + struct bt_declaration *nested_declaration, struct ctf_trace *trace) { /* @@ -483,7 +483,7 @@ struct declaration *ctf_type_declarator_visit(FILE *fd, int depth, *field_name = 0; return nested_declaration; } else { - struct declaration *declaration; + struct bt_declaration *declaration; struct ctf_node *first; /* TYPEDEC_NESTED */ @@ -562,7 +562,7 @@ int ctf_struct_type_declarators_visit(FILE *fd, int depth, GQuark field_name; bt_list_for_each_entry(iter, type_declarators, siblings) { - struct declaration *field_declaration; + struct bt_declaration *field_declaration; field_declaration = ctf_type_declarator_visit(fd, depth, type_specifier_list, @@ -600,7 +600,7 @@ int ctf_variant_type_declarators_visit(FILE *fd, int depth, GQuark field_name; bt_list_for_each_entry(iter, type_declarators, siblings) { - struct declaration *field_declaration; + struct bt_declaration *field_declaration; field_declaration = ctf_type_declarator_visit(fd, depth, type_specifier_list, @@ -635,7 +635,7 @@ int ctf_typedef_visit(FILE *fd, int depth, struct declaration_scope *scope, GQuark identifier; bt_list_for_each_entry(iter, type_declarators, siblings) { - struct declaration *type_declaration; + struct bt_declaration *type_declaration; int ret; type_declaration = ctf_type_declarator_visit(fd, depth, @@ -670,7 +670,7 @@ int ctf_typealias_visit(FILE *fd, int depth, struct declaration_scope *scope, struct ctf_node *target, struct ctf_node *alias, struct ctf_trace *trace) { - struct declaration *type_declaration; + struct bt_declaration *type_declaration; struct ctf_node *node; GQuark dummy_id; GQuark alias_q; @@ -744,7 +744,7 @@ int ctf_struct_declaration_list_visit(FILE *fd, int depth, switch (iter->type) { case NODE_TYPEDEF: - /* For each declarator, declare type and add type to struct declaration scope */ + /* For each declarator, declare type and add type to struct bt_declaration scope */ ret = ctf_typedef_visit(fd, depth, struct_declaration->scope, iter->u._typedef.type_specifier_list, @@ -753,7 +753,7 @@ int ctf_struct_declaration_list_visit(FILE *fd, int depth, return ret; break; case NODE_TYPEALIAS: - /* Declare type with declarator and add type to struct declaration scope */ + /* Declare type with declarator and add type to struct bt_declaration scope */ ret = ctf_typealias_visit(fd, depth, struct_declaration->scope, iter->u.typealias.target, @@ -823,7 +823,7 @@ int ctf_variant_declaration_list_visit(FILE *fd, int depth, } static -struct declaration *ctf_declaration_struct_visit(FILE *fd, +struct bt_declaration *ctf_declaration_struct_visit(FILE *fd, int depth, const char *name, struct bt_list_head *declaration_list, int has_body, struct bt_list_head *min_align, struct declaration_scope *declaration_scope, @@ -894,7 +894,7 @@ error: } static -struct declaration *ctf_declaration_variant_visit(FILE *fd, +struct bt_declaration *ctf_declaration_variant_visit(FILE *fd, int depth, const char *name, const char *choice, struct bt_list_head *declaration_list, int has_body, struct declaration_scope *declaration_scope, @@ -1053,7 +1053,7 @@ int ctf_enumerator_list_visit(FILE *fd, int depth, } static -struct declaration *ctf_declaration_enum_visit(FILE *fd, int depth, +struct bt_declaration *ctf_declaration_enum_visit(FILE *fd, int depth, const char *name, struct ctf_node *container_type, struct bt_list_head *enumerator_list, @@ -1061,7 +1061,7 @@ struct declaration *ctf_declaration_enum_visit(FILE *fd, int depth, struct declaration_scope *declaration_scope, struct ctf_trace *trace) { - struct declaration *declaration; + struct bt_declaration *declaration; struct declaration_enum *enum_declaration; struct declaration_integer *integer_declaration; struct last_enum_value last_value; @@ -1146,12 +1146,12 @@ error: } static -struct declaration *ctf_declaration_type_specifier_visit(FILE *fd, int depth, +struct bt_declaration *ctf_declaration_type_specifier_visit(FILE *fd, int depth, struct ctf_node *type_specifier_list, struct declaration_scope *declaration_scope) { GString *str; - struct declaration *declaration; + struct bt_declaration *declaration; char *str_c; int ret; GQuark id_q; @@ -1263,7 +1263,7 @@ int get_byte_order(FILE *fd, int depth, struct ctf_node *unary_expression, } static -struct declaration *ctf_declaration_integer_visit(FILE *fd, int depth, +struct bt_declaration *ctf_declaration_integer_visit(FILE *fd, int depth, struct bt_list_head *expressions, struct ctf_trace *trace) { @@ -1449,7 +1449,7 @@ struct declaration *ctf_declaration_integer_visit(FILE *fd, int depth, } static -struct declaration *ctf_declaration_floating_point_visit(FILE *fd, int depth, +struct bt_declaration *ctf_declaration_floating_point_visit(FILE *fd, int depth, struct bt_list_head *expressions, struct ctf_trace *trace) { @@ -1528,7 +1528,7 @@ struct declaration *ctf_declaration_floating_point_visit(FILE *fd, int depth, } static -struct declaration *ctf_declaration_string_visit(FILE *fd, int depth, +struct bt_declaration *ctf_declaration_string_visit(FILE *fd, int depth, struct bt_list_head *expressions, struct ctf_trace *trace) { @@ -1564,7 +1564,7 @@ struct declaration *ctf_declaration_string_visit(FILE *fd, int depth, static -struct declaration *ctf_type_specifier_list_visit(FILE *fd, +struct bt_declaration *ctf_type_specifier_list_visit(FILE *fd, int depth, struct ctf_node *type_specifier_list, struct declaration_scope *declaration_scope, struct ctf_trace *trace) @@ -1715,7 +1715,7 @@ int ctf_event_declaration_visit(FILE *fd, int depth, struct ctf_node *node, stru } CTF_EVENT_SET_FIELD(event, stream_id); } else if (!strcmp(left, "context")) { - struct declaration *declaration; + struct bt_declaration *declaration; if (event->context_decl) { fprintf(fd, "[error] %s: context already declared in event declaration\n", __func__); @@ -1736,7 +1736,7 @@ int ctf_event_declaration_visit(FILE *fd, int depth, struct ctf_node *node, stru } event->context_decl = container_of(declaration, struct declaration_struct, p); } else if (!strcmp(left, "fields")) { - struct declaration *declaration; + struct bt_declaration *declaration; if (event->fields_decl) { fprintf(fd, "[error] %s: fields already declared in event declaration\n", __func__); @@ -1915,7 +1915,7 @@ int ctf_stream_declaration_visit(FILE *fd, int depth, struct ctf_node *node, str } CTF_STREAM_SET_FIELD(stream, stream_id); } else if (!strcmp(left, "event.header")) { - struct declaration *declaration; + struct bt_declaration *declaration; if (stream->event_header_decl) { fprintf(fd, "[error] %s: event.header already declared in stream declaration\n", __func__); @@ -1936,7 +1936,7 @@ int ctf_stream_declaration_visit(FILE *fd, int depth, struct ctf_node *node, str } stream->event_header_decl = container_of(declaration, struct declaration_struct, p); } else if (!strcmp(left, "event.context")) { - struct declaration *declaration; + struct bt_declaration *declaration; if (stream->event_context_decl) { fprintf(fd, "[error] %s: event.context already declared in stream declaration\n", __func__); @@ -1957,7 +1957,7 @@ int ctf_stream_declaration_visit(FILE *fd, int depth, struct ctf_node *node, str } stream->event_context_decl = container_of(declaration, struct declaration_struct, p); } else if (!strcmp(left, "packet.context")) { - struct declaration *declaration; + struct bt_declaration *declaration; if (stream->packet_context_decl) { fprintf(fd, "[error] %s: packet.context already declared in stream declaration\n", __func__); @@ -2155,7 +2155,7 @@ int ctf_trace_declaration_visit(FILE *fd, int depth, struct ctf_node *node, stru } CTF_TRACE_SET_FIELD(trace, byte_order); } else if (!strcmp(left, "packet.header")) { - struct declaration *declaration; + struct bt_declaration *declaration; if (trace->packet_header_decl) { fprintf(fd, "[error] %s: packet.header already declared in trace declaration\n", __func__); @@ -2841,7 +2841,7 @@ int ctf_root_declaration_visit(FILE *fd, int depth, struct ctf_node *node, struc break; case NODE_TYPE_SPECIFIER_LIST: { - struct declaration *declaration; + struct bt_declaration *declaration; /* * Just add the type specifier to the root scope diff --git a/formats/ctf/types/array.c b/formats/ctf/types/array.c index 683c171..ea3ecfd 100644 --- a/formats/ctf/types/array.c +++ b/formats/ctf/types/array.c @@ -34,7 +34,7 @@ int ctf_array_read(struct bt_stream_pos *ppos, struct bt_definition *definition) container_of(definition, struct definition_array, p); struct declaration_array *array_declaration = array_definition->declaration; - struct declaration *elem = array_declaration->elem; + struct bt_declaration *elem = array_declaration->elem; struct ctf_stream_pos *pos = container_of(ppos, struct ctf_stream_pos, parent); @@ -70,7 +70,7 @@ int ctf_array_write(struct bt_stream_pos *ppos, struct bt_definition *definition container_of(definition, struct definition_array, p); struct declaration_array *array_declaration = array_definition->declaration; - struct declaration *elem = array_declaration->elem; + struct bt_declaration *elem = array_declaration->elem; struct ctf_stream_pos *pos = container_of(ppos, struct ctf_stream_pos, parent); diff --git a/formats/ctf/types/sequence.c b/formats/ctf/types/sequence.c index 53ebf75..898c367 100644 --- a/formats/ctf/types/sequence.c +++ b/formats/ctf/types/sequence.c @@ -34,7 +34,7 @@ int ctf_sequence_read(struct bt_stream_pos *ppos, struct bt_definition *definiti container_of(definition, struct definition_sequence, p); struct declaration_sequence *sequence_declaration = sequence_definition->declaration; - struct declaration *elem = sequence_declaration->elem; + struct bt_declaration *elem = sequence_declaration->elem; struct ctf_stream_pos *pos = ctf_pos(ppos); if (elem->id == CTF_TYPE_INTEGER) { @@ -69,7 +69,7 @@ int ctf_sequence_write(struct bt_stream_pos *ppos, struct bt_definition *definit container_of(definition, struct definition_sequence, p); struct declaration_sequence *sequence_declaration = sequence_definition->declaration; - struct declaration *elem = sequence_declaration->elem; + struct bt_declaration *elem = sequence_declaration->elem; struct ctf_stream_pos *pos = ctf_pos(ppos); if (elem->id == CTF_TYPE_INTEGER) { diff --git a/formats/ctf/types/struct.c b/formats/ctf/types/struct.c index b004767..106f682 100644 --- a/formats/ctf/types/struct.c +++ b/formats/ctf/types/struct.c @@ -30,7 +30,7 @@ int ctf_struct_rw(struct bt_stream_pos *ppos, struct bt_definition *definition) { - struct declaration *declaration = definition->declaration; + struct bt_declaration *declaration = definition->declaration; struct ctf_stream_pos *pos = ctf_pos(ppos); ctf_align_pos(pos, declaration->alignment); diff --git a/formats/ctf/types/variant.c b/formats/ctf/types/variant.c index ece8b33..b3d6396 100644 --- a/formats/ctf/types/variant.c +++ b/formats/ctf/types/variant.c @@ -30,7 +30,7 @@ int ctf_variant_rw(struct bt_stream_pos *ppos, struct bt_definition *definition) { - struct declaration *declaration = definition->declaration; + struct bt_declaration *declaration = definition->declaration; struct ctf_stream_pos *pos = ctf_pos(ppos); ctf_align_pos(pos, declaration->alignment); diff --git a/include/babeltrace/ctf/events.h b/include/babeltrace/ctf/events.h index ecc5c28..c92470c 100644 --- a/include/babeltrace/ctf/events.h +++ b/include/babeltrace/ctf/events.h @@ -40,7 +40,7 @@ extern "C" { #endif struct bt_definition; -struct declaration; +struct bt_declaration; struct bt_ctf_event; struct bt_ctf_event_decl; struct bt_ctf_field_decl; @@ -158,19 +158,19 @@ const char *bt_ctf_field_name(const struct bt_definition *def); * bt_ctf_get_decl_from_def: return the declaration of a field from * its definition or NULL on error */ -const struct declaration *bt_ctf_get_decl_from_def(const struct bt_definition *def); +const struct bt_declaration *bt_ctf_get_decl_from_def(const struct bt_definition *def); /* * bt_ctf_get_decl_from_field_decl: return the declaration of a field from * a field_decl or NULL on error */ -const struct declaration *bt_ctf_get_decl_from_field_decl( +const struct bt_declaration *bt_ctf_get_decl_from_field_decl( const struct bt_ctf_field_decl *field); /* * bt_ctf_field_type: returns the type of a field or -1 if unknown */ -enum ctf_type_id bt_ctf_field_type(const struct declaration *decl); +enum ctf_type_id bt_ctf_field_type(const struct bt_declaration *decl); /* * bt_ctf_get_int_signedness: return the signedness of an integer @@ -179,37 +179,37 @@ enum ctf_type_id bt_ctf_field_type(const struct declaration *decl); * return 1 if signed * return -1 on error */ -int bt_ctf_get_int_signedness(const struct declaration *decl); +int bt_ctf_get_int_signedness(const struct bt_declaration *decl); /* * bt_ctf_get_int_base: return the base of an int or a negative value on error */ -int bt_ctf_get_int_base(const struct declaration *decl); +int bt_ctf_get_int_base(const struct bt_declaration *decl); /* * bt_ctf_get_int_byte_order: return the byte order of an int or a negative * value on error */ -int bt_ctf_get_int_byte_order(const struct declaration *decl); +int bt_ctf_get_int_byte_order(const struct bt_declaration *decl); /* * bt_ctf_get_int_len: return the size, in bits, of an int or a negative * value on error */ -ssize_t bt_ctf_get_int_len(const struct declaration *decl); +ssize_t bt_ctf_get_int_len(const struct bt_declaration *decl); /* * bt_ctf_get_encoding: return the encoding of an int, a string, or of * the integer contained in a char array or a sequence. * return a negative value on error */ -enum ctf_string_encoding bt_ctf_get_encoding(const struct declaration *decl); +enum ctf_string_encoding bt_ctf_get_encoding(const struct bt_declaration *decl); /* * bt_ctf_get_array_len: return the len of an array or a negative * value on error */ -int bt_ctf_get_array_len(const struct declaration *decl); +int bt_ctf_get_array_len(const struct bt_declaration *decl); /* * Field access functions diff --git a/include/babeltrace/types.h b/include/babeltrace/types.h index 0b8d1c1..22c6876 100644 --- a/include/babeltrace/types.h +++ b/include/babeltrace/types.h @@ -78,16 +78,16 @@ struct definition_scope { GArray *scope_path; /* array of GQuark */ }; -struct declaration { +struct bt_declaration { enum ctf_type_id id; size_t alignment; /* type alignment, in bits */ int ref; /* number of references to the type */ /* * declaration_free called with declaration ref is decremented to 0. */ - void (*declaration_free)(struct declaration *declaration); + void (*declaration_free)(struct bt_declaration *declaration); struct bt_definition * - (*definition_new)(struct declaration *declaration, + (*definition_new)(struct bt_declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index, const char *root_name); @@ -98,7 +98,7 @@ struct declaration { }; struct bt_definition { - struct declaration *declaration; + struct bt_declaration *declaration; int index; /* Position of the definition in its container */ GQuark name; /* Field name in its container (or 0 if unset) */ int ref; /* number of references to the definition */ @@ -134,7 +134,7 @@ int generic_rw(struct bt_stream_pos *pos, struct bt_definition *definition) * read/write non aligned on CHAR_BIT. */ struct declaration_integer { - struct declaration p; + struct bt_declaration p; size_t len; /* length, in bits. */ int byte_order; /* byte order */ int signedness; @@ -154,7 +154,7 @@ struct definition_integer { }; struct declaration_float { - struct declaration p; + struct bt_declaration p; struct declaration_integer *sign; struct declaration_integer *mantissa; struct declaration_integer *exp; @@ -211,7 +211,7 @@ struct enum_table { }; struct declaration_enum { - struct declaration p; + struct bt_declaration p; struct declaration_integer *integer_declaration; struct enum_table table; }; @@ -225,7 +225,7 @@ struct definition_enum { }; struct declaration_string { - struct declaration p; + struct bt_declaration p; enum ctf_string_encoding encoding; }; @@ -238,11 +238,11 @@ struct definition_string { struct declaration_field { GQuark name; - struct declaration *declaration; + struct bt_declaration *declaration; }; struct declaration_struct { - struct declaration p; + struct bt_declaration p; GHashTable *fields_by_name; /* Tuples (field name, field index) */ struct declaration_scope *scope; GArray *fields; /* Array of declaration_field */ @@ -255,14 +255,14 @@ struct definition_struct { }; struct declaration_untagged_variant { - struct declaration p; + struct bt_declaration p; GHashTable *fields_by_tag; /* Tuples (field tag, field index) */ struct declaration_scope *scope; GArray *fields; /* Array of declaration_field */ }; struct declaration_variant { - struct declaration p; + struct bt_declaration p; struct declaration_untagged_variant *untagged_variant; GArray *tag_name; /* Array of GQuark */ }; @@ -277,9 +277,9 @@ struct definition_variant { }; struct declaration_array { - struct declaration p; + struct bt_declaration p; size_t len; - struct declaration *elem; + struct bt_declaration *elem; struct declaration_scope *scope; }; @@ -291,9 +291,9 @@ struct definition_array { }; struct declaration_sequence { - struct declaration p; + struct bt_declaration p; GArray *length_name; /* Array of GQuark */ - struct declaration *elem; + struct bt_declaration *elem; struct declaration_scope *scope; }; @@ -306,9 +306,9 @@ struct definition_sequence { }; int bt_register_declaration(GQuark declaration_name, - struct declaration *declaration, + struct bt_declaration *declaration, struct declaration_scope *scope); -struct declaration *bt_lookup_declaration(GQuark declaration_name, +struct bt_declaration *bt_lookup_declaration(GQuark declaration_name, struct declaration_scope *scope); /* @@ -364,8 +364,8 @@ int compare_definition_path(struct bt_definition *definition, GQuark path) return definition->path == path; } -void bt_declaration_ref(struct declaration *declaration); -void bt_declaration_unref(struct declaration *declaration); +void bt_declaration_ref(struct bt_declaration *declaration); +void bt_declaration_unref(struct bt_declaration *declaration); void bt_definition_ref(struct bt_definition *definition); void bt_definition_unref(struct bt_definition *definition); @@ -435,7 +435,7 @@ struct declaration_struct * uint64_t min_align); void bt_struct_declaration_add_field(struct declaration_struct *struct_declaration, const char *field_name, - struct declaration *field_declaration); + struct bt_declaration *field_declaration); /* * Returns the index of a field within a structure. */ @@ -465,7 +465,7 @@ struct declaration_variant *bt_variant_declaration_new(struct declaration_untagg void bt_untagged_variant_declaration_add_field(struct declaration_untagged_variant *untagged_variant_declaration, const char *field_name, - struct declaration *field_declaration); + struct bt_declaration *field_declaration); struct declaration_field * bt_untagged_variant_declaration_get_field_from_tag(struct declaration_untagged_variant *untagged_variant_declaration, GQuark tag); @@ -488,7 +488,7 @@ int bt_variant_rw(struct bt_stream_pos *pos, struct bt_definition *definition); * array. */ struct declaration_array * - bt_array_declaration_new(size_t len, struct declaration *elem_declaration, + bt_array_declaration_new(size_t len, struct bt_declaration *elem_declaration, struct declaration_scope *parent_scope); uint64_t bt_array_len(struct definition_array *array); struct bt_definition *bt_array_index(struct definition_array *array, uint64_t i); @@ -502,7 +502,7 @@ int bt_get_array_len(const struct bt_definition *field); */ struct declaration_sequence * bt_sequence_declaration_new(const char *length_name, - struct declaration *elem_declaration, + struct bt_declaration *elem_declaration, struct declaration_scope *parent_scope); uint64_t bt_sequence_len(struct definition_sequence *sequence); struct bt_definition *bt_sequence_index(struct definition_sequence *sequence, uint64_t i); diff --git a/types/array.c b/types/array.c index debc15a..c9b973b 100644 --- a/types/array.c +++ b/types/array.c @@ -32,7 +32,7 @@ #include static -struct bt_definition *_array_definition_new(struct declaration *declaration, +struct bt_definition *_array_definition_new(struct bt_declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index, const char *root_name); static @@ -59,7 +59,7 @@ int bt_array_rw(struct bt_stream_pos *pos, struct bt_definition *definition) } static -void _array_declaration_free(struct declaration *declaration) +void _array_declaration_free(struct bt_declaration *declaration) { struct declaration_array *array_declaration = container_of(declaration, struct declaration_array, p); @@ -71,11 +71,11 @@ void _array_declaration_free(struct declaration *declaration) struct declaration_array * bt_array_declaration_new(size_t len, - struct declaration *elem_declaration, + struct bt_declaration *elem_declaration, struct declaration_scope *parent_scope) { struct declaration_array *array_declaration; - struct declaration *declaration; + struct bt_declaration *declaration; array_declaration = g_new(struct declaration_array, 1); declaration = &array_declaration->p; @@ -94,7 +94,7 @@ struct declaration_array * static struct bt_definition * - _array_definition_new(struct declaration *declaration, + _array_definition_new(struct bt_declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index, const char *root_name) { @@ -229,7 +229,7 @@ GString *bt_get_char_array(const struct bt_definition *field) { struct definition_array *array_definition; struct declaration_array *array_declaration; - struct declaration *elem; + struct bt_declaration *elem; array_definition = container_of(field, struct definition_array, p); array_declaration = array_definition->declaration; diff --git a/types/enum.c b/types/enum.c index e967e14..8394e1b 100644 --- a/types/enum.c +++ b/types/enum.c @@ -41,7 +41,7 @@ #endif static -struct bt_definition *_enum_definition_new(struct declaration *declaration, +struct bt_definition *_enum_definition_new(struct bt_declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index, const char *root_name); @@ -374,7 +374,7 @@ size_t bt_enum_get_nr_enumerators(struct declaration_enum *enum_declaration) } static -void _enum_declaration_free(struct declaration *declaration) +void _enum_declaration_free(struct bt_declaration *declaration) { struct declaration_enum *enum_declaration = container_of(declaration, struct declaration_enum, p); @@ -418,7 +418,7 @@ struct declaration_enum * static struct bt_definition * - _enum_definition_new(struct declaration *declaration, + _enum_definition_new(struct bt_declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index, const char *root_name) diff --git a/types/float.c b/types/float.c index 7aeb9c3..3b61f8f 100644 --- a/types/float.c +++ b/types/float.c @@ -32,7 +32,7 @@ #include static -struct bt_definition *_float_definition_new(struct declaration *declaration, +struct bt_definition *_float_definition_new(struct bt_declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index, const char *root_name); @@ -40,7 +40,7 @@ static void _float_definition_free(struct bt_definition *definition); static -void _float_declaration_free(struct declaration *declaration) +void _float_declaration_free(struct bt_declaration *declaration) { struct declaration_float *float_declaration = container_of(declaration, struct declaration_float, p); @@ -56,7 +56,7 @@ struct declaration_float * size_t exp_len, int byte_order, size_t alignment) { struct declaration_float *float_declaration; - struct declaration *declaration; + struct bt_declaration *declaration; float_declaration = g_new(struct declaration_float, 1); declaration = &float_declaration->p; @@ -82,7 +82,7 @@ struct declaration_float * static struct bt_definition * - _float_definition_new(struct declaration *declaration, + _float_definition_new(struct bt_declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index, const char *root_name) diff --git a/types/integer.c b/types/integer.c index 92c7eb1..73d4f2a 100644 --- a/types/integer.c +++ b/types/integer.c @@ -33,7 +33,7 @@ #include static -struct bt_definition *_integer_definition_new(struct declaration *declaration, +struct bt_definition *_integer_definition_new(struct bt_declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index, const char *root_name); @@ -41,7 +41,7 @@ static void _integer_definition_free(struct bt_definition *definition); static -void _integer_declaration_free(struct declaration *declaration) +void _integer_declaration_free(struct bt_declaration *declaration) { struct declaration_integer *integer_declaration = container_of(declaration, struct declaration_integer, p); @@ -74,7 +74,7 @@ struct declaration_integer * static struct bt_definition * - _integer_definition_new(struct declaration *declaration, + _integer_definition_new(struct bt_declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index, const char *root_name) diff --git a/types/sequence.c b/types/sequence.c index 8792325..6c61ef7 100644 --- a/types/sequence.c +++ b/types/sequence.c @@ -32,7 +32,7 @@ #include static -struct bt_definition *_sequence_definition_new(struct declaration *declaration, +struct bt_definition *_sequence_definition_new(struct bt_declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index, const char *root_name); @@ -88,7 +88,7 @@ int bt_sequence_rw(struct bt_stream_pos *pos, struct bt_definition *definition) } static -void _sequence_declaration_free(struct declaration *declaration) +void _sequence_declaration_free(struct bt_declaration *declaration) { struct declaration_sequence *sequence_declaration = container_of(declaration, struct declaration_sequence, p); @@ -101,11 +101,11 @@ void _sequence_declaration_free(struct declaration *declaration) struct declaration_sequence * bt_sequence_declaration_new(const char *length, - struct declaration *elem_declaration, + struct bt_declaration *elem_declaration, struct declaration_scope *parent_scope) { struct declaration_sequence *sequence_declaration; - struct declaration *declaration; + struct bt_declaration *declaration; sequence_declaration = g_new(struct declaration_sequence, 1); declaration = &sequence_declaration->p; @@ -126,7 +126,7 @@ struct declaration_sequence * } static -struct bt_definition *_sequence_definition_new(struct declaration *declaration, +struct bt_definition *_sequence_definition_new(struct bt_declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index, const char *root_name) diff --git a/types/string.c b/types/string.c index 5db1716..5bbba98 100644 --- a/types/string.c +++ b/types/string.c @@ -32,7 +32,7 @@ #include static -struct bt_definition *_string_definition_new(struct declaration *declaration, +struct bt_definition *_string_definition_new(struct bt_declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index, const char *root_name); @@ -40,7 +40,7 @@ static void _string_definition_free(struct bt_definition *definition); static -void _string_declaration_free(struct declaration *declaration) +void _string_declaration_free(struct bt_declaration *declaration) { struct declaration_string *string_declaration = container_of(declaration, struct declaration_string, p); @@ -65,7 +65,7 @@ struct declaration_string * static struct bt_definition * - _string_definition_new(struct declaration *declaration, + _string_definition_new(struct bt_declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index, const char *root_name) diff --git a/types/struct.c b/types/struct.c index fadc187..b9fb679 100644 --- a/types/struct.c +++ b/types/struct.c @@ -36,7 +36,7 @@ #endif static -struct bt_definition *_struct_definition_new(struct declaration *declaration, +struct bt_definition *_struct_definition_new(struct bt_declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index, const char *root_name); @@ -61,7 +61,7 @@ int bt_struct_rw(struct bt_stream_pos *ppos, struct bt_definition *definition) } static -void _struct_declaration_free(struct declaration *declaration) +void _struct_declaration_free(struct bt_declaration *declaration) { struct declaration_struct *struct_declaration = container_of(declaration, struct declaration_struct, p); @@ -85,7 +85,7 @@ struct declaration_struct * uint64_t min_align) { struct declaration_struct *struct_declaration; - struct declaration *declaration; + struct bt_declaration *declaration; struct_declaration = g_new(struct declaration_struct, 1); declaration = &struct_declaration->p; @@ -106,7 +106,7 @@ struct declaration_struct * static struct bt_definition * - _struct_definition_new(struct declaration *declaration, + _struct_definition_new(struct bt_declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index, const char *root_name) @@ -183,7 +183,7 @@ void _struct_definition_free(struct bt_definition *definition) void bt_struct_declaration_add_field(struct declaration_struct *struct_declaration, const char *field_name, - struct declaration *field_declaration) + struct bt_declaration *field_declaration) { struct declaration_field *field; unsigned long index; diff --git a/types/types.c b/types/types.c index b235c13..0d1a89d 100644 --- a/types/types.c +++ b/types/types.c @@ -51,7 +51,7 @@ GQuark prefix_quark(const char *prefix, GQuark quark) } static -struct declaration * +struct bt_declaration * bt_lookup_declaration_scope(GQuark declaration_name, struct declaration_scope *scope) { @@ -59,10 +59,10 @@ struct declaration * (gconstpointer) (unsigned long) declaration_name); } -struct declaration *bt_lookup_declaration(GQuark declaration_name, +struct bt_declaration *bt_lookup_declaration(GQuark declaration_name, struct declaration_scope *scope) { - struct declaration *declaration; + struct bt_declaration *declaration; while (scope) { declaration = bt_lookup_declaration_scope(declaration_name, @@ -74,7 +74,7 @@ struct declaration *bt_lookup_declaration(GQuark declaration_name, return NULL; } -int bt_register_declaration(GQuark name, struct declaration *declaration, +int bt_register_declaration(GQuark name, struct bt_declaration *declaration, struct declaration_scope *scope) { if (!name) @@ -279,12 +279,12 @@ int bt_register_field_definition(GQuark field_name, struct bt_definition *defini return 0; } -void bt_declaration_ref(struct declaration *declaration) +void bt_declaration_ref(struct bt_declaration *declaration) { declaration->ref++; } -void bt_declaration_unref(struct declaration *declaration) +void bt_declaration_unref(struct bt_declaration *declaration) { if (!declaration) return; diff --git a/types/variant.c b/types/variant.c index ed29550..1f0dc6a 100644 --- a/types/variant.c +++ b/types/variant.c @@ -32,7 +32,7 @@ #include static -struct bt_definition *_variant_definition_new(struct declaration *declaration, +struct bt_definition *_variant_definition_new(struct bt_declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index, const char *root_name); @@ -50,7 +50,7 @@ int bt_variant_rw(struct bt_stream_pos *ppos, struct bt_definition *definition) } static -void _untagged_variant_declaration_free(struct declaration *declaration) +void _untagged_variant_declaration_free(struct bt_declaration *declaration) { struct declaration_untagged_variant *untagged_variant_declaration = container_of(declaration, struct declaration_untagged_variant, p); @@ -73,7 +73,7 @@ struct declaration_untagged_variant *bt_untagged_bt_variant_declaration_new( struct declaration_scope *parent_scope) { struct declaration_untagged_variant *untagged_variant_declaration; - struct declaration *declaration; + struct bt_declaration *declaration; untagged_variant_declaration = g_new(struct declaration_untagged_variant, 1); declaration = &untagged_variant_declaration->p; @@ -93,7 +93,7 @@ struct declaration_untagged_variant *bt_untagged_bt_variant_declaration_new( } static -void _variant_declaration_free(struct declaration *declaration) +void _variant_declaration_free(struct bt_declaration *declaration) { struct declaration_variant *variant_declaration = container_of(declaration, struct declaration_variant, p); @@ -107,7 +107,7 @@ struct declaration_variant * bt_variant_declaration_new(struct declaration_untagged_variant *untagged_variant, const char *tag) { struct declaration_variant *variant_declaration; - struct declaration *declaration; + struct bt_declaration *declaration; variant_declaration = g_new(struct declaration_variant, 1); declaration = &variant_declaration->p; @@ -173,7 +173,7 @@ int check_enum_tag(struct definition_variant *variant, static struct bt_definition * - _variant_definition_new(struct declaration *declaration, + _variant_definition_new(struct bt_declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index, const char *root_name) @@ -259,7 +259,7 @@ void _variant_definition_free(struct bt_definition *definition) void bt_untagged_variant_declaration_add_field(struct declaration_untagged_variant *untagged_variant_declaration, const char *field_name, - struct declaration *field_declaration) + struct bt_declaration *field_declaration) { struct declaration_field *field; unsigned long index; -- 1.7.10.4 From jdesfossez at efficios.com Fri Feb 15 12:22:55 2013 From: jdesfossez at efficios.com (Julien Desfossez) Date: Fri, 15 Feb 2013 12:22:55 -0500 Subject: [lttng-dev] [BABELTRACE PATCH 6/7] Namespace the struct definition In-Reply-To: <1360948976-14999-1-git-send-email-jdesfossez@efficios.com> References: <1360948976-14999-1-git-send-email-jdesfossez@efficios.com> Message-ID: <1360948976-14999-6-git-send-email-jdesfossez@efficios.com> This struct is exposed in the public API, so we need to namespace it. Signed-off-by: Julien Desfossez --- formats/ctf-text/ctf-text.c | 2 +- formats/ctf-text/types/array.c | 2 +- formats/ctf-text/types/enum.c | 2 +- formats/ctf-text/types/float.c | 2 +- formats/ctf-text/types/integer.c | 2 +- formats/ctf-text/types/sequence.c | 2 +- formats/ctf-text/types/string.c | 2 +- formats/ctf-text/types/struct.c | 2 +- formats/ctf-text/types/variant.c | 2 +- formats/ctf/ctf.c | 32 ++++++------ formats/ctf/events.c | 44 ++++++++-------- formats/ctf/types/array.c | 4 +- formats/ctf/types/enum.c | 4 +- formats/ctf/types/float.c | 8 +-- formats/ctf/types/integer.c | 8 +-- formats/ctf/types/sequence.c | 4 +- formats/ctf/types/string.c | 4 +- formats/ctf/types/struct.c | 2 +- formats/ctf/types/variant.c | 2 +- include/babeltrace/ctf-text/types.h | 18 +++---- include/babeltrace/ctf/events.h | 32 ++++++------ include/babeltrace/ctf/types.h | 28 +++++----- include/babeltrace/types.h | 98 +++++++++++++++++------------------ types/array.c | 26 +++++----- types/enum.c | 10 ++-- types/float.c | 10 ++-- types/integer.c | 22 ++++---- types/sequence.c | 26 +++++----- types/string.c | 12 ++--- types/struct.c | 22 ++++---- types/types.c | 28 +++++----- types/variant.c | 22 ++++---- 32 files changed, 242 insertions(+), 242 deletions(-) diff --git a/formats/ctf-text/ctf-text.c b/formats/ctf-text/ctf-text.c index cd69125..e9fd741 100644 --- a/formats/ctf-text/ctf-text.c +++ b/formats/ctf-text/ctf-text.c @@ -135,7 +135,7 @@ struct ctf_callsite_dups *ctf_trace_callsite_lookup(struct ctf_trace *trace, (gpointer) (unsigned long) callsite_name); } -int print_field(struct definition *definition) +int print_field(struct bt_definition *definition) { /* Print all fields in verbose mode */ if (babeltrace_verbose) diff --git a/formats/ctf-text/types/array.c b/formats/ctf-text/types/array.c index 9e7d49f..d9f57a2 100644 --- a/formats/ctf-text/types/array.c +++ b/formats/ctf-text/types/array.c @@ -29,7 +29,7 @@ #include #include -int ctf_text_array_write(struct bt_stream_pos *ppos, struct definition *definition) +int ctf_text_array_write(struct bt_stream_pos *ppos, struct bt_definition *definition) { struct ctf_text_stream_pos *pos = ctf_text_pos(ppos); struct definition_array *array_definition = diff --git a/formats/ctf-text/types/enum.c b/formats/ctf-text/types/enum.c index 8a2463b..6470500 100644 --- a/formats/ctf-text/types/enum.c +++ b/formats/ctf-text/types/enum.c @@ -30,7 +30,7 @@ #include #include -int ctf_text_enum_write(struct bt_stream_pos *ppos, struct definition *definition) +int ctf_text_enum_write(struct bt_stream_pos *ppos, struct bt_definition *definition) { struct definition_enum *enum_definition = container_of(definition, struct definition_enum, p); diff --git a/formats/ctf-text/types/float.c b/formats/ctf-text/types/float.c index a925480..a4946f9 100644 --- a/formats/ctf-text/types/float.c +++ b/formats/ctf-text/types/float.c @@ -31,7 +31,7 @@ #include #include -int ctf_text_float_write(struct bt_stream_pos *ppos, struct definition *definition) +int ctf_text_float_write(struct bt_stream_pos *ppos, struct bt_definition *definition) { struct definition_float *float_definition = container_of(definition, struct definition_float, p); diff --git a/formats/ctf-text/types/integer.c b/formats/ctf-text/types/integer.c index 3a469f6..7363b52 100644 --- a/formats/ctf-text/types/integer.c +++ b/formats/ctf-text/types/integer.c @@ -32,7 +32,7 @@ #include #include -int ctf_text_integer_write(struct bt_stream_pos *ppos, struct definition *definition) +int ctf_text_integer_write(struct bt_stream_pos *ppos, struct bt_definition *definition) { struct definition_integer *integer_definition = container_of(definition, struct definition_integer, p); diff --git a/formats/ctf-text/types/sequence.c b/formats/ctf-text/types/sequence.c index 61be860..706fe5e 100644 --- a/formats/ctf-text/types/sequence.c +++ b/formats/ctf-text/types/sequence.c @@ -29,7 +29,7 @@ #include #include -int ctf_text_sequence_write(struct bt_stream_pos *ppos, struct definition *definition) +int ctf_text_sequence_write(struct bt_stream_pos *ppos, struct bt_definition *definition) { struct ctf_text_stream_pos *pos = ctf_text_pos(ppos); struct definition_sequence *sequence_definition = diff --git a/formats/ctf-text/types/string.c b/formats/ctf-text/types/string.c index f49d1b7..c397f0e 100644 --- a/formats/ctf-text/types/string.c +++ b/formats/ctf-text/types/string.c @@ -32,7 +32,7 @@ #include int ctf_text_string_write(struct bt_stream_pos *ppos, - struct definition *definition) + struct bt_definition *definition) { struct definition_string *string_definition = container_of(definition, struct definition_string, p); diff --git a/formats/ctf-text/types/struct.c b/formats/ctf-text/types/struct.c index a727a89..1b9e27e 100644 --- a/formats/ctf-text/types/struct.c +++ b/formats/ctf-text/types/struct.c @@ -29,7 +29,7 @@ #include #include -int ctf_text_struct_write(struct bt_stream_pos *ppos, struct definition *definition) +int ctf_text_struct_write(struct bt_stream_pos *ppos, struct bt_definition *definition) { struct declaration *declaration = definition->declaration; struct declaration_struct *struct_declaration = diff --git a/formats/ctf-text/types/variant.c b/formats/ctf-text/types/variant.c index ca7c1ae..3aeb6ec 100644 --- a/formats/ctf-text/types/variant.c +++ b/formats/ctf-text/types/variant.c @@ -29,7 +29,7 @@ #include #include -int ctf_text_variant_write(struct bt_stream_pos *ppos, struct definition *definition) +int ctf_text_variant_write(struct bt_stream_pos *ppos, struct bt_definition *definition) { struct ctf_text_stream_pos *pos = ctf_text_pos(ppos); int field_nr_saved; diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index aea12a1..5a51495 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -421,7 +421,7 @@ int ctf_read_event(struct bt_stream_pos *ppos, struct ctf_stream_definition *str /* Read event header */ if (likely(stream->stream_event_header)) { struct definition_integer *integer_definition; - struct definition *variant; + struct bt_definition *variant; ret = generic_rw(ppos, &stream->stream_event_header->p); if (unlikely(ret)) @@ -1150,7 +1150,7 @@ struct ctf_event_definition *create_event_definitions(struct ctf_trace *td, struct ctf_event_definition *stream_event = g_new0(struct ctf_event_definition, 1); if (event->context_decl) { - struct definition *definition = + struct bt_definition *definition = event->context_decl->p.definition_new(&event->context_decl->p, stream->parent_def_scope, 0, 0, "event.context"); if (!definition) { @@ -1161,7 +1161,7 @@ struct ctf_event_definition *create_event_definitions(struct ctf_trace *td, stream->parent_def_scope = stream_event->event_context->p.scope; } if (event->fields_decl) { - struct definition *definition = + struct bt_definition *definition = event->fields_decl->p.definition_new(&event->fields_decl->p, stream->parent_def_scope, 0, 0, "event.fields"); if (!definition) { @@ -1195,7 +1195,7 @@ int create_stream_definitions(struct ctf_trace *td, struct ctf_stream_definition stream_class = stream->stream_class; if (stream_class->packet_context_decl) { - struct definition *definition = + struct bt_definition *definition = stream_class->packet_context_decl->p.definition_new(&stream_class->packet_context_decl->p, stream->parent_def_scope, 0, 0, "stream.packet.context"); if (!definition) { @@ -1207,7 +1207,7 @@ int create_stream_definitions(struct ctf_trace *td, struct ctf_stream_definition stream->parent_def_scope = stream->stream_packet_context->p.scope; } if (stream_class->event_header_decl) { - struct definition *definition = + struct bt_definition *definition = stream_class->event_header_decl->p.definition_new(&stream_class->event_header_decl->p, stream->parent_def_scope, 0, 0, "stream.event.header"); if (!definition) { @@ -1219,7 +1219,7 @@ int create_stream_definitions(struct ctf_trace *td, struct ctf_stream_definition stream->parent_def_scope = stream->stream_event_header->p.scope; } if (stream_class->event_context_decl) { - struct definition *definition = + struct bt_definition *definition = stream_class->event_context_decl->p.definition_new(&stream_class->event_context_decl->p, stream->parent_def_scope, 0, 0, "stream.event.context"); if (!definition) { @@ -1321,7 +1321,7 @@ int create_stream_packet_index(struct ctf_trace *td, return ret; len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.trace_packet_header->declaration, g_quark_from_static_string("magic")); if (len_index >= 0) { - struct definition *field; + struct bt_definition *field; uint64_t magic; field = bt_struct_definition_get_field_from_index(file_stream->parent.trace_packet_header, len_index); @@ -1339,7 +1339,7 @@ int create_stream_packet_index(struct ctf_trace *td, len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.trace_packet_header->declaration, g_quark_from_static_string("uuid")); if (len_index >= 0) { struct definition_array *defarray; - struct definition *field; + struct bt_definition *field; uint64_t i; uint8_t uuidval[BABELTRACE_UUID_LEN]; @@ -1349,7 +1349,7 @@ int create_stream_packet_index(struct ctf_trace *td, assert(bt_array_len(defarray) == BABELTRACE_UUID_LEN); for (i = 0; i < BABELTRACE_UUID_LEN; i++) { - struct definition *elem; + struct bt_definition *elem; elem = bt_array_index(defarray, i); uuidval[i] = bt_get_unsigned_int(elem); @@ -1364,7 +1364,7 @@ int create_stream_packet_index(struct ctf_trace *td, len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.trace_packet_header->declaration, g_quark_from_static_string("stream_id")); if (len_index >= 0) { - struct definition *field; + struct bt_definition *field; field = bt_struct_definition_get_field_from_index(file_stream->parent.trace_packet_header, len_index); stream_id = bt_get_unsigned_int(field); @@ -1401,7 +1401,7 @@ int create_stream_packet_index(struct ctf_trace *td, /* read content size from header */ len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_static_string("content_size")); if (len_index >= 0) { - struct definition *field; + struct bt_definition *field; field = bt_struct_definition_get_field_from_index(file_stream->parent.stream_packet_context, len_index); packet_index.content_size = bt_get_unsigned_int(field); @@ -1413,7 +1413,7 @@ int create_stream_packet_index(struct ctf_trace *td, /* read packet size from header */ len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_static_string("packet_size")); if (len_index >= 0) { - struct definition *field; + struct bt_definition *field; field = bt_struct_definition_get_field_from_index(file_stream->parent.stream_packet_context, len_index); packet_index.packet_size = bt_get_unsigned_int(field); @@ -1425,7 +1425,7 @@ int create_stream_packet_index(struct ctf_trace *td, /* read timestamp begin from header */ len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_static_string("timestamp_begin")); if (len_index >= 0) { - struct definition *field; + struct bt_definition *field; field = bt_struct_definition_get_field_from_index(file_stream->parent.stream_packet_context, len_index); packet_index.timestamp_begin = bt_get_unsigned_int(field); @@ -1440,7 +1440,7 @@ int create_stream_packet_index(struct ctf_trace *td, /* read timestamp end from header */ len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_static_string("timestamp_end")); if (len_index >= 0) { - struct definition *field; + struct bt_definition *field; field = bt_struct_definition_get_field_from_index(file_stream->parent.stream_packet_context, len_index); packet_index.timestamp_end = bt_get_unsigned_int(field); @@ -1455,7 +1455,7 @@ int create_stream_packet_index(struct ctf_trace *td, /* read events discarded from header */ len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_static_string("events_discarded")); if (len_index >= 0) { - struct definition *field; + struct bt_definition *field; field = bt_struct_definition_get_field_from_index(file_stream->parent.stream_packet_context, len_index); packet_index.events_discarded = bt_get_unsigned_int(field); @@ -1499,7 +1499,7 @@ int create_trace_definitions(struct ctf_trace *td, struct ctf_stream_definition int ret; if (td->packet_header_decl) { - struct definition *definition = + struct bt_definition *definition = td->packet_header_decl->p.definition_new(&td->packet_header_decl->p, stream->parent_def_scope, 0, 0, "trace.packet.header"); if (!definition) { diff --git a/formats/ctf/events.c b/formats/ctf/events.c index d9460b1..af7f5e1 100644 --- a/formats/ctf/events.c +++ b/formats/ctf/events.c @@ -46,10 +46,10 @@ */ __thread int bt_ctf_last_field_error = 0; -const struct definition *bt_ctf_get_top_level_scope(const struct bt_ctf_event *ctf_event, +const struct bt_definition *bt_ctf_get_top_level_scope(const struct bt_ctf_event *ctf_event, enum bt_ctf_scope scope) { - const struct definition *tmp = NULL; + const struct bt_definition *tmp = NULL; const struct ctf_event_definition *event; if (!ctf_event) @@ -96,11 +96,11 @@ error: return NULL; } -const struct definition *bt_ctf_get_field(const struct bt_ctf_event *ctf_event, - const struct definition *scope, +const struct bt_definition *bt_ctf_get_field(const struct bt_ctf_event *ctf_event, + const struct bt_definition *scope, const char *field) { - const struct definition *def; + const struct bt_definition *def; char *field_underscore; if (!ctf_event || !scope || !field) @@ -127,11 +127,11 @@ const struct definition *bt_ctf_get_field(const struct bt_ctf_event *ctf_event, return def; } -const struct definition *bt_ctf_get_index(const struct bt_ctf_event *ctf_event, - const struct definition *field, +const struct bt_definition *bt_ctf_get_index(const struct bt_ctf_event *ctf_event, + const struct bt_definition *field, unsigned int index) { - struct definition *ret = NULL; + struct bt_definition *ret = NULL; if (!ctf_event || !field) return NULL; @@ -166,7 +166,7 @@ const char *bt_ctf_event_name(const struct bt_ctf_event *ctf_event) return g_quark_to_string(event_class->name); } -const char *bt_ctf_field_name(const struct definition *def) +const char *bt_ctf_field_name(const struct bt_definition *def) { if (!def || !def->name) return NULL; @@ -183,8 +183,8 @@ enum ctf_type_id bt_ctf_field_type(const struct declaration *decl) } int bt_ctf_get_field_list(const struct bt_ctf_event *ctf_event, - const struct definition *scope, - struct definition const * const **list, + const struct bt_definition *scope, + struct bt_definition const * const **list, unsigned int *count) { if (!ctf_event || !scope || !list || !count) @@ -204,7 +204,7 @@ int bt_ctf_get_field_list(const struct bt_ctf_event *ctf_event, if (!def_struct) goto error; if (def_struct->fields->pdata) { - *list = (struct definition const* const*) def_struct->fields->pdata; + *list = (struct bt_definition const* const*) def_struct->fields->pdata; *count = def_struct->fields->len; goto end; } else { @@ -222,7 +222,7 @@ int bt_ctf_get_field_list(const struct bt_ctf_event *ctf_event, if (!def_variant) goto error; if (def_variant->fields->pdata) { - *list = (struct definition const* const*) def_variant->fields->pdata; + *list = (struct bt_definition const* const*) def_variant->fields->pdata; *count = def_variant->fields->len; goto end; } else { @@ -238,7 +238,7 @@ int bt_ctf_get_field_list(const struct bt_ctf_event *ctf_event, if (!def_array) goto error; if (def_array->elems->pdata) { - *list = (struct definition const* const*) def_array->elems->pdata; + *list = (struct bt_definition const* const*) def_array->elems->pdata; *count = def_array->elems->len; goto end; } else { @@ -254,7 +254,7 @@ int bt_ctf_get_field_list(const struct bt_ctf_event *ctf_event, if (!def_sequence) goto error; if (def_sequence->elems->pdata) { - *list = (struct definition const* const*) def_sequence->elems->pdata; + *list = (struct bt_definition const* const*) def_sequence->elems->pdata; *count = def_sequence->elems->len; goto end; } else { @@ -437,7 +437,7 @@ ssize_t bt_ctf_get_int_len(const struct declaration *decl) return (ssize_t) integer->len; } -const struct definition *bt_ctf_get_enum_int(const struct definition *field) +const struct bt_definition *bt_ctf_get_enum_int(const struct bt_definition *field) { const struct definition_enum *def_enum; @@ -449,7 +449,7 @@ const struct definition *bt_ctf_get_enum_int(const struct definition *field) return &def_enum->integer->p; } -const char *bt_ctf_get_enum_str(const struct definition *field) +const char *bt_ctf_get_enum_str(const struct bt_definition *field) { const struct definition_enum *def_enum; const struct declaration_enum *decl_enum; @@ -554,7 +554,7 @@ error: return -1; } -uint64_t bt_ctf_get_uint64(const struct definition *field) +uint64_t bt_ctf_get_uint64(const struct bt_definition *field) { uint64_t ret = 0; @@ -566,7 +566,7 @@ uint64_t bt_ctf_get_uint64(const struct definition *field) return ret; } -int64_t bt_ctf_get_int64(const struct definition *field) +int64_t bt_ctf_get_int64(const struct bt_definition *field) { int64_t ret = 0; @@ -578,7 +578,7 @@ int64_t bt_ctf_get_int64(const struct definition *field) return ret; } -char *bt_ctf_get_char_array(const struct definition *field) +char *bt_ctf_get_char_array(const struct bt_definition *field) { char *ret = NULL; GString *char_array; @@ -596,7 +596,7 @@ end: return ret; } -char *bt_ctf_get_string(const struct definition *field) +char *bt_ctf_get_string(const struct bt_definition *field) { char *ret = NULL; @@ -767,7 +767,7 @@ const char *bt_ctf_get_decl_field_name(const struct bt_ctf_field_decl *field) return rem_(g_quark_to_string(((struct declaration_field *) field)->name)); } -const struct declaration *bt_ctf_get_decl_from_def(const struct definition *def) +const struct declaration *bt_ctf_get_decl_from_def(const struct bt_definition *def) { if (def) return def->declaration; diff --git a/formats/ctf/types/array.c b/formats/ctf/types/array.c index b1cbe2f..683c171 100644 --- a/formats/ctf/types/array.c +++ b/formats/ctf/types/array.c @@ -28,7 +28,7 @@ #include -int ctf_array_read(struct bt_stream_pos *ppos, struct definition *definition) +int ctf_array_read(struct bt_stream_pos *ppos, struct bt_definition *definition) { struct definition_array *array_definition = container_of(definition, struct definition_array, p); @@ -64,7 +64,7 @@ int ctf_array_read(struct bt_stream_pos *ppos, struct definition *definition) return bt_array_rw(ppos, definition); } -int ctf_array_write(struct bt_stream_pos *ppos, struct definition *definition) +int ctf_array_write(struct bt_stream_pos *ppos, struct bt_definition *definition) { struct definition_array *array_definition = container_of(definition, struct definition_array, p); diff --git a/formats/ctf/types/enum.c b/formats/ctf/types/enum.c index 9371b27..9461af6 100644 --- a/formats/ctf/types/enum.c +++ b/formats/ctf/types/enum.c @@ -31,7 +31,7 @@ #include #include -int ctf_enum_read(struct bt_stream_pos *ppos, struct definition *definition) +int ctf_enum_read(struct bt_stream_pos *ppos, struct bt_definition *definition) { struct definition_enum *enum_definition = container_of(definition, struct definition_enum, p); @@ -69,7 +69,7 @@ int ctf_enum_read(struct bt_stream_pos *ppos, struct definition *definition) return 0; } -int ctf_enum_write(struct bt_stream_pos *pos, struct definition *definition) +int ctf_enum_write(struct bt_stream_pos *pos, struct bt_definition *definition) { struct definition_enum *enum_definition = container_of(definition, struct definition_enum, p); diff --git a/formats/ctf/types/float.c b/formats/ctf/types/float.c index f46e26a..2e0bd5c 100644 --- a/formats/ctf/types/float.c +++ b/formats/ctf/types/float.c @@ -165,7 +165,7 @@ static int _ctf_float_copy(struct bt_stream_pos *destp, return 0; } -int ctf_float_read(struct bt_stream_pos *ppos, struct definition *definition) +int ctf_float_read(struct bt_stream_pos *ppos, struct bt_definition *definition) { struct definition_float *float_definition = container_of(definition, struct definition_float, p); @@ -173,7 +173,7 @@ int ctf_float_read(struct bt_stream_pos *ppos, struct definition *definition) float_definition->declaration; struct ctf_stream_pos *pos = ctf_pos(ppos); union doubleIEEE754 u; - struct definition *tmpdef; + struct bt_definition *tmpdef; struct definition_float *tmpfloat; struct ctf_stream_pos destp; struct mmap_align mma; @@ -222,7 +222,7 @@ end: return ret; } -int ctf_float_write(struct bt_stream_pos *ppos, struct definition *definition) +int ctf_float_write(struct bt_stream_pos *ppos, struct bt_definition *definition) { struct definition_float *float_definition = container_of(definition, struct definition_float, p); @@ -230,7 +230,7 @@ int ctf_float_write(struct bt_stream_pos *ppos, struct definition *definition) float_definition->declaration; struct ctf_stream_pos *pos = ctf_pos(ppos); union doubleIEEE754 u; - struct definition *tmpdef; + struct bt_definition *tmpdef; struct definition_float *tmpfloat; struct ctf_stream_pos srcp; struct mmap_align mma; diff --git a/formats/ctf/types/integer.c b/formats/ctf/types/integer.c index 1267925..257341a 100644 --- a/formats/ctf/types/integer.c +++ b/formats/ctf/types/integer.c @@ -40,7 +40,7 @@ static int _aligned_integer_read(struct bt_stream_pos *ppos, - struct definition *definition) + struct bt_definition *definition) { struct definition_integer *integer_definition = container_of(definition, struct definition_integer, p); @@ -142,7 +142,7 @@ int _aligned_integer_read(struct bt_stream_pos *ppos, static int _aligned_integer_write(struct bt_stream_pos *ppos, - struct definition *definition) + struct bt_definition *definition) { struct definition_integer *integer_definition = container_of(definition, struct definition_integer, p); @@ -211,7 +211,7 @@ end: return 0; } -int ctf_integer_read(struct bt_stream_pos *ppos, struct definition *definition) +int ctf_integer_read(struct bt_stream_pos *ppos, struct bt_definition *definition) { struct definition_integer *integer_definition = container_of(definition, struct definition_integer, p); @@ -256,7 +256,7 @@ int ctf_integer_read(struct bt_stream_pos *ppos, struct definition *definition) return 0; } -int ctf_integer_write(struct bt_stream_pos *ppos, struct definition *definition) +int ctf_integer_write(struct bt_stream_pos *ppos, struct bt_definition *definition) { struct definition_integer *integer_definition = container_of(definition, struct definition_integer, p); diff --git a/formats/ctf/types/sequence.c b/formats/ctf/types/sequence.c index b2221ea..53ebf75 100644 --- a/formats/ctf/types/sequence.c +++ b/formats/ctf/types/sequence.c @@ -28,7 +28,7 @@ #include -int ctf_sequence_read(struct bt_stream_pos *ppos, struct definition *definition) +int ctf_sequence_read(struct bt_stream_pos *ppos, struct bt_definition *definition) { struct definition_sequence *sequence_definition = container_of(definition, struct definition_sequence, p); @@ -63,7 +63,7 @@ int ctf_sequence_read(struct bt_stream_pos *ppos, struct definition *definition) return bt_sequence_rw(ppos, definition); } -int ctf_sequence_write(struct bt_stream_pos *ppos, struct definition *definition) +int ctf_sequence_write(struct bt_stream_pos *ppos, struct bt_definition *definition) { struct definition_sequence *sequence_definition = container_of(definition, struct definition_sequence, p); diff --git a/formats/ctf/types/string.c b/formats/ctf/types/string.c index 5771733..a2433bf 100644 --- a/formats/ctf/types/string.c +++ b/formats/ctf/types/string.c @@ -31,7 +31,7 @@ #include /* C99 limits */ #include -int ctf_string_read(struct bt_stream_pos *ppos, struct definition *definition) +int ctf_string_read(struct bt_stream_pos *ppos, struct bt_definition *definition) { struct definition_string *string_definition = container_of(definition, struct definition_string, p); @@ -69,7 +69,7 @@ int ctf_string_read(struct bt_stream_pos *ppos, struct definition *definition) } int ctf_string_write(struct bt_stream_pos *ppos, - struct definition *definition) + struct bt_definition *definition) { struct definition_string *string_definition = container_of(definition, struct definition_string, p); diff --git a/formats/ctf/types/struct.c b/formats/ctf/types/struct.c index 7c1562b..b004767 100644 --- a/formats/ctf/types/struct.c +++ b/formats/ctf/types/struct.c @@ -28,7 +28,7 @@ #include -int ctf_struct_rw(struct bt_stream_pos *ppos, struct definition *definition) +int ctf_struct_rw(struct bt_stream_pos *ppos, struct bt_definition *definition) { struct declaration *declaration = definition->declaration; struct ctf_stream_pos *pos = ctf_pos(ppos); diff --git a/formats/ctf/types/variant.c b/formats/ctf/types/variant.c index 3c0c371..ece8b33 100644 --- a/formats/ctf/types/variant.c +++ b/formats/ctf/types/variant.c @@ -28,7 +28,7 @@ #include -int ctf_variant_rw(struct bt_stream_pos *ppos, struct definition *definition) +int ctf_variant_rw(struct bt_stream_pos *ppos, struct bt_definition *definition) { struct declaration *declaration = definition->declaration; struct ctf_stream_pos *pos = ctf_pos(ppos); diff --git a/include/babeltrace/ctf-text/types.h b/include/babeltrace/ctf-text/types.h index 15c8333..74a68a1 100644 --- a/include/babeltrace/ctf-text/types.h +++ b/include/babeltrace/ctf-text/types.h @@ -62,21 +62,21 @@ struct ctf_text_stream_pos *ctf_text_pos(struct bt_stream_pos *pos) * Write only is supported for now. */ BT_HIDDEN -int ctf_text_integer_write(struct bt_stream_pos *pos, struct definition *definition); +int ctf_text_integer_write(struct bt_stream_pos *pos, struct bt_definition *definition); BT_HIDDEN -int ctf_text_float_write(struct bt_stream_pos *pos, struct definition *definition); +int ctf_text_float_write(struct bt_stream_pos *pos, struct bt_definition *definition); BT_HIDDEN -int ctf_text_string_write(struct bt_stream_pos *pos, struct definition *definition); +int ctf_text_string_write(struct bt_stream_pos *pos, struct bt_definition *definition); BT_HIDDEN -int ctf_text_enum_write(struct bt_stream_pos *pos, struct definition *definition); +int ctf_text_enum_write(struct bt_stream_pos *pos, struct bt_definition *definition); BT_HIDDEN -int ctf_text_struct_write(struct bt_stream_pos *pos, struct definition *definition); +int ctf_text_struct_write(struct bt_stream_pos *pos, struct bt_definition *definition); BT_HIDDEN -int ctf_text_variant_write(struct bt_stream_pos *pos, struct definition *definition); +int ctf_text_variant_write(struct bt_stream_pos *pos, struct bt_definition *definition); BT_HIDDEN -int ctf_text_array_write(struct bt_stream_pos *pos, struct definition *definition); +int ctf_text_array_write(struct bt_stream_pos *pos, struct bt_definition *definition); BT_HIDDEN -int ctf_text_sequence_write(struct bt_stream_pos *pos, struct definition *definition); +int ctf_text_sequence_write(struct bt_stream_pos *pos, struct bt_definition *definition); static inline void print_pos_tabs(struct ctf_text_stream_pos *pos) @@ -91,6 +91,6 @@ void print_pos_tabs(struct ctf_text_stream_pos *pos) * Check if the field must be printed. */ BT_HIDDEN -int print_field(struct definition *definition); +int print_field(struct bt_definition *definition); #endif /* _BABELTRACE_CTF_TEXT_TYPES_H */ diff --git a/include/babeltrace/ctf/events.h b/include/babeltrace/ctf/events.h index 19d7361..ecc5c28 100644 --- a/include/babeltrace/ctf/events.h +++ b/include/babeltrace/ctf/events.h @@ -39,7 +39,7 @@ extern "C" { #endif -struct definition; +struct bt_definition; struct declaration; struct bt_ctf_event; struct bt_ctf_event_decl; @@ -94,7 +94,7 @@ enum ctf_string_encoding { * between the enum and the actual definition of top-level scopes. * On error return NULL. */ -const struct definition *bt_ctf_get_top_level_scope(const struct bt_ctf_event *event, +const struct bt_definition *bt_ctf_get_top_level_scope(const struct bt_ctf_event *event, enum bt_ctf_scope scope); /* @@ -130,35 +130,35 @@ uint64_t bt_ctf_get_timestamp(const struct bt_ctf_event *event); * from which the event is extracted is unchanged). */ int bt_ctf_get_field_list(const struct bt_ctf_event *event, - const struct definition *scope, - struct definition const * const **list, + const struct bt_definition *scope, + struct bt_definition const * const **list, unsigned int *count); /* * bt_ctf_get_field: returns the definition of a specific field */ -const struct definition *bt_ctf_get_field(const struct bt_ctf_event *event, - const struct definition *scope, +const struct bt_definition *bt_ctf_get_field(const struct bt_ctf_event *event, + const struct bt_definition *scope, const char *field); /* * bt_ctf_get_index: if the field is an array or a sequence, return the element * at position index, otherwise return NULL; */ -const struct definition *bt_ctf_get_index(const struct bt_ctf_event *event, - const struct definition *field, +const struct bt_definition *bt_ctf_get_index(const struct bt_ctf_event *event, + const struct bt_definition *field, unsigned int index); /* * bt_ctf_field_name: returns the name of a field or NULL on error */ -const char *bt_ctf_field_name(const struct definition *def); +const char *bt_ctf_field_name(const struct bt_definition *def); /* * bt_ctf_get_decl_from_def: return the declaration of a field from * its definition or NULL on error */ -const struct declaration *bt_ctf_get_decl_from_def(const struct definition *def); +const struct declaration *bt_ctf_get_decl_from_def(const struct bt_definition *def); /* * bt_ctf_get_decl_from_field_decl: return the declaration of a field from @@ -225,12 +225,12 @@ int bt_ctf_get_array_len(const struct declaration *decl); * bt_ctf_get_enum_str gets the string matching the current enumeration * value, or NULL if the current value does not match any string. */ -uint64_t bt_ctf_get_uint64(const struct definition *field); -int64_t bt_ctf_get_int64(const struct definition *field); -const struct definition *bt_ctf_get_enum_int(const struct definition *field); -const char *bt_ctf_get_enum_str(const struct definition *field); -char *bt_ctf_get_char_array(const struct definition *field); -char *bt_ctf_get_string(const struct definition *field); +uint64_t bt_ctf_get_uint64(const struct bt_definition *field); +int64_t bt_ctf_get_int64(const struct bt_definition *field); +const struct bt_definition *bt_ctf_get_enum_int(const struct bt_definition *field); +const char *bt_ctf_get_enum_str(const struct bt_definition *field); +char *bt_ctf_get_char_array(const struct bt_definition *field); +char *bt_ctf_get_string(const struct bt_definition *field); /* * bt_ctf_field_get_error: returns the last error code encountered while diff --git a/include/babeltrace/ctf/types.h b/include/babeltrace/ctf/types.h index f7b93d3..781b942 100644 --- a/include/babeltrace/ctf/types.h +++ b/include/babeltrace/ctf/types.h @@ -91,33 +91,33 @@ struct ctf_stream_pos *ctf_pos(struct bt_stream_pos *pos) } BT_HIDDEN -int ctf_integer_read(struct bt_stream_pos *pos, struct definition *definition); +int ctf_integer_read(struct bt_stream_pos *pos, struct bt_definition *definition); BT_HIDDEN -int ctf_integer_write(struct bt_stream_pos *pos, struct definition *definition); +int ctf_integer_write(struct bt_stream_pos *pos, struct bt_definition *definition); BT_HIDDEN -int ctf_float_read(struct bt_stream_pos *pos, struct definition *definition); +int ctf_float_read(struct bt_stream_pos *pos, struct bt_definition *definition); BT_HIDDEN -int ctf_float_write(struct bt_stream_pos *pos, struct definition *definition); +int ctf_float_write(struct bt_stream_pos *pos, struct bt_definition *definition); BT_HIDDEN -int ctf_string_read(struct bt_stream_pos *pos, struct definition *definition); +int ctf_string_read(struct bt_stream_pos *pos, struct bt_definition *definition); BT_HIDDEN -int ctf_string_write(struct bt_stream_pos *pos, struct definition *definition); +int ctf_string_write(struct bt_stream_pos *pos, struct bt_definition *definition); BT_HIDDEN -int ctf_enum_read(struct bt_stream_pos *pos, struct definition *definition); +int ctf_enum_read(struct bt_stream_pos *pos, struct bt_definition *definition); BT_HIDDEN -int ctf_enum_write(struct bt_stream_pos *pos, struct definition *definition); +int ctf_enum_write(struct bt_stream_pos *pos, struct bt_definition *definition); BT_HIDDEN -int ctf_struct_rw(struct bt_stream_pos *pos, struct definition *definition); +int ctf_struct_rw(struct bt_stream_pos *pos, struct bt_definition *definition); BT_HIDDEN -int ctf_variant_rw(struct bt_stream_pos *pos, struct definition *definition); +int ctf_variant_rw(struct bt_stream_pos *pos, struct bt_definition *definition); BT_HIDDEN -int ctf_array_read(struct bt_stream_pos *pos, struct definition *definition); +int ctf_array_read(struct bt_stream_pos *pos, struct bt_definition *definition); BT_HIDDEN -int ctf_array_write(struct bt_stream_pos *pos, struct definition *definition); +int ctf_array_write(struct bt_stream_pos *pos, struct bt_definition *definition); BT_HIDDEN -int ctf_sequence_read(struct bt_stream_pos *pos, struct definition *definition); +int ctf_sequence_read(struct bt_stream_pos *pos, struct bt_definition *definition); BT_HIDDEN -int ctf_sequence_write(struct bt_stream_pos *pos, struct definition *definition); +int ctf_sequence_write(struct bt_stream_pos *pos, struct bt_definition *definition); void ctf_packet_seek(struct bt_stream_pos *pos, size_t index, int whence); diff --git a/include/babeltrace/types.h b/include/babeltrace/types.h index 093ef0c..0b8d1c1 100644 --- a/include/babeltrace/types.h +++ b/include/babeltrace/types.h @@ -45,7 +45,7 @@ struct ctf_stream_definition; struct bt_stream_pos; struct bt_format; -struct definition; +struct bt_definition; struct ctf_clock; /* type scope */ @@ -86,7 +86,7 @@ struct declaration { * declaration_free called with declaration ref is decremented to 0. */ void (*declaration_free)(struct declaration *declaration); - struct definition * + struct bt_definition * (*definition_new)(struct declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index, @@ -94,10 +94,10 @@ struct declaration { /* * definition_free called with definition ref is decremented to 0. */ - void (*definition_free)(struct definition *definition); + void (*definition_free)(struct bt_definition *definition); }; -struct definition { +struct bt_definition { struct declaration *declaration; int index; /* Position of the definition in its container */ GQuark name; /* Field name in its container (or 0 if unset) */ @@ -107,7 +107,7 @@ struct definition { }; typedef int (*rw_dispatch)(struct bt_stream_pos *pos, - struct definition *definition); + struct bt_definition *definition); /* Parent of per-plugin positions */ struct bt_stream_pos { @@ -118,7 +118,7 @@ struct bt_stream_pos { }; static inline -int generic_rw(struct bt_stream_pos *pos, struct definition *definition) +int generic_rw(struct bt_stream_pos *pos, struct bt_definition *definition) { enum ctf_type_id dispatch_id = definition->declaration->id; rw_dispatch call; @@ -144,7 +144,7 @@ struct declaration_integer { }; struct definition_integer { - struct definition p; + struct bt_definition p; struct declaration_integer *declaration; /* Last values read */ union { @@ -163,7 +163,7 @@ struct declaration_float { }; struct definition_float { - struct definition p; + struct bt_definition p; struct declaration_float *declaration; struct definition_integer *sign; struct definition_integer *mantissa; @@ -217,7 +217,7 @@ struct declaration_enum { }; struct definition_enum { - struct definition p; + struct bt_definition p; struct definition_integer *integer; struct declaration_enum *declaration; /* Last GQuark values read. Keeping a reference on the GQuark array. */ @@ -230,7 +230,7 @@ struct declaration_string { }; struct definition_string { - struct definition p; + struct bt_definition p; struct declaration_string *declaration; char *value; /* freed at definition_string teardown */ size_t len, alloc_len; @@ -249,9 +249,9 @@ struct declaration_struct { }; struct definition_struct { - struct definition p; + struct bt_definition p; struct declaration_struct *declaration; - GPtrArray *fields; /* Array of pointers to struct definition */ + GPtrArray *fields; /* Array of pointers to struct bt_definition */ }; struct declaration_untagged_variant { @@ -269,11 +269,11 @@ struct declaration_variant { /* A variant needs to be tagged to be defined. */ struct definition_variant { - struct definition p; + struct bt_definition p; struct declaration_variant *declaration; - struct definition *enum_tag; - GPtrArray *fields; /* Array of pointers to struct definition */ - struct definition *current_field; /* Last field read */ + struct bt_definition *enum_tag; + GPtrArray *fields; /* Array of pointers to struct bt_definition */ + struct bt_definition *current_field; /* Last field read */ }; struct declaration_array { @@ -284,9 +284,9 @@ struct declaration_array { }; struct definition_array { - struct definition p; + struct bt_definition p; struct declaration_array *declaration; - GPtrArray *elems; /* Array of pointers to struct definition */ + GPtrArray *elems; /* Array of pointers to struct bt_definition */ GString *string; /* String for encoded integer children */ }; @@ -298,10 +298,10 @@ struct declaration_sequence { }; struct definition_sequence { - struct definition p; + struct bt_definition p; struct declaration_sequence *declaration; struct definition_integer *length; - GPtrArray *elems; /* Array of pointers to struct definition */ + GPtrArray *elems; /* Array of pointers to struct bt_definition */ GString *string; /* String for encoded integer children */ }; @@ -343,12 +343,12 @@ void bt_free_declaration_scope(struct declaration_scope *scope); * field_definition is for field definitions. They are registered into * definition scopes. */ -struct definition * +struct bt_definition * bt_lookup_path_definition(GArray *cur_path, /* array of GQuark */ GArray *lookup_path, /* array of GQuark */ struct definition_scope *scope); int bt_register_field_definition(GQuark field_name, - struct definition *definition, + struct bt_definition *definition, struct definition_scope *scope); struct definition_scope * bt_new_definition_scope(struct definition_scope *parent_scope, @@ -359,7 +359,7 @@ GQuark bt_new_definition_path(struct definition_scope *parent_scope, GQuark field_name, const char *root_name); static inline -int compare_definition_path(struct definition *definition, GQuark path) +int compare_definition_path(struct bt_definition *definition, GQuark path) { return definition->path == path; } @@ -367,20 +367,20 @@ int compare_definition_path(struct definition *definition, GQuark path) void bt_declaration_ref(struct declaration *declaration); void bt_declaration_unref(struct declaration *declaration); -void bt_definition_ref(struct definition *definition); -void bt_definition_unref(struct definition *definition); +void bt_definition_ref(struct bt_definition *definition); +void bt_definition_unref(struct bt_definition *definition); struct declaration_integer *bt_integer_declaration_new(size_t len, int byte_order, int signedness, size_t alignment, int base, enum ctf_string_encoding encoding, struct ctf_clock *clock); -uint64_t bt_get_unsigned_int(const struct definition *field); -int64_t bt_get_signed_int(const struct definition *field); -int bt_get_int_signedness(const struct definition *field); -int bt_get_int_byte_order(const struct definition *field); -int bt_get_int_base(const struct definition *field); -size_t bt_get_int_len(const struct definition *field); /* in bits */ -enum ctf_string_encoding bt_get_int_encoding(const struct definition *field); +uint64_t bt_get_unsigned_int(const struct bt_definition *field); +int64_t bt_get_signed_int(const struct bt_definition *field); +int bt_get_int_signedness(const struct bt_definition *field); +int bt_get_int_byte_order(const struct bt_definition *field); +int bt_get_int_base(const struct bt_definition *field); +size_t bt_get_int_len(const struct bt_definition *field); /* in bits */ +enum ctf_string_encoding bt_get_int_encoding(const struct bt_definition *field); /* * mantissa_len is the length of the number of bytes represented by the mantissa @@ -427,8 +427,8 @@ struct declaration_enum * struct declaration_string * bt_string_declaration_new(enum ctf_string_encoding encoding); -char *bt_get_string(const struct definition *field); -enum ctf_string_encoding bt_get_string_encoding(const struct definition *field); +char *bt_get_string(const struct bt_definition *field); +enum ctf_string_encoding bt_get_string_encoding(const struct bt_definition *field); struct declaration_struct * bt_struct_declaration_new(struct declaration_scope *parent_scope, @@ -447,10 +447,10 @@ int bt_struct_declaration_lookup_field_index(struct declaration_struct *struct_d struct declaration_field * bt_struct_declaration_get_field_from_index(struct declaration_struct *struct_declaration, int index); -struct definition * +struct bt_definition * bt_struct_definition_get_field_from_index(struct definition_struct *struct_definition, int index); -int bt_struct_rw(struct bt_stream_pos *pos, struct definition *definition); +int bt_struct_rw(struct bt_stream_pos *pos, struct bt_definition *definition); uint64_t bt_struct_declaration_len(struct declaration_struct *struct_declaration); /* @@ -473,14 +473,14 @@ struct declaration_field * * Returns 0 on success, -EPERM on error. */ int variant_definition_set_tag(struct definition_variant *variant, - struct definition *enum_tag); + struct bt_definition *enum_tag); /* * Returns the field selected by the current tag value. * field returned only valid as long as the variant structure is not appended * to. */ -struct definition *bt_variant_get_current_field(struct definition_variant *variant); -int bt_variant_rw(struct bt_stream_pos *pos, struct definition *definition); +struct bt_definition *bt_variant_get_current_field(struct definition_variant *variant); +int bt_variant_rw(struct bt_stream_pos *pos, struct bt_definition *definition); /* * elem_declaration passed as parameter now belongs to the array. No @@ -491,10 +491,10 @@ struct declaration_array * bt_array_declaration_new(size_t len, struct declaration *elem_declaration, struct declaration_scope *parent_scope); uint64_t bt_array_len(struct definition_array *array); -struct definition *bt_array_index(struct definition_array *array, uint64_t i); -int bt_array_rw(struct bt_stream_pos *pos, struct definition *definition); -GString *bt_get_char_array(const struct definition *field); -int bt_get_array_len(const struct definition *field); +struct bt_definition *bt_array_index(struct definition_array *array, uint64_t i); +int bt_array_rw(struct bt_stream_pos *pos, struct bt_definition *definition); +GString *bt_get_char_array(const struct bt_definition *field); +int bt_get_array_len(const struct bt_definition *field); /* * int_declaration and elem_declaration passed as parameter now belong @@ -505,8 +505,8 @@ struct declaration_sequence * struct declaration *elem_declaration, struct declaration_scope *parent_scope); uint64_t bt_sequence_len(struct definition_sequence *sequence); -struct definition *bt_sequence_index(struct definition_sequence *sequence, uint64_t i); -int bt_sequence_rw(struct bt_stream_pos *pos, struct definition *definition); +struct bt_definition *bt_sequence_index(struct definition_sequence *sequence, uint64_t i); +int bt_sequence_rw(struct bt_stream_pos *pos, struct bt_definition *definition); /* * in: path (dot separated), out: q (GArray of GQuark) @@ -516,15 +516,15 @@ void bt_append_scope_path(const char *path, GArray *q); /* * Lookup helpers. */ -struct definition *bt_lookup_definition(const struct definition *definition, +struct bt_definition *bt_lookup_definition(const struct bt_definition *definition, const char *field_name); -struct definition_integer *bt_lookup_integer(const struct definition *definition, +struct definition_integer *bt_lookup_integer(const struct bt_definition *definition, const char *field_name, int signedness); -struct definition_enum *bt_lookup_enum(const struct definition *definition, +struct definition_enum *bt_lookup_enum(const struct bt_definition *definition, const char *field_name, int signedness); -struct definition *bt_lookup_variant(const struct definition *definition, +struct bt_definition *bt_lookup_variant(const struct bt_definition *definition, const char *field_name); static inline diff --git a/types/array.c b/types/array.c index 43decb5..debc15a 100644 --- a/types/array.c +++ b/types/array.c @@ -32,13 +32,13 @@ #include static -struct definition *_array_definition_new(struct declaration *declaration, +struct bt_definition *_array_definition_new(struct declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index, const char *root_name); static -void _array_definition_free(struct definition *definition); +void _array_definition_free(struct bt_definition *definition); -int bt_array_rw(struct bt_stream_pos *pos, struct definition *definition) +int bt_array_rw(struct bt_stream_pos *pos, struct bt_definition *definition) { struct definition_array *array_definition = container_of(definition, struct definition_array, p); @@ -49,7 +49,7 @@ int bt_array_rw(struct bt_stream_pos *pos, struct definition *definition) /* No need to align, because the first field will align itself. */ for (i = 0; i < array_declaration->len; i++) { - struct definition *field = + struct bt_definition *field = g_ptr_array_index(array_definition->elems, i); ret = generic_rw(pos, field); if (ret) @@ -93,7 +93,7 @@ struct declaration_array * } static -struct definition * +struct bt_definition * _array_definition_new(struct declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index, const char *root_name) @@ -142,7 +142,7 @@ struct definition * array->elems = g_ptr_array_sized_new(array_declaration->len); g_ptr_array_set_size(array->elems, array_declaration->len); for (i = 0; i < array_declaration->len; i++) { - struct definition **field; + struct bt_definition **field; GString *str; GQuark name; @@ -151,7 +151,7 @@ struct definition * name = g_quark_from_string(str->str); (void) g_string_free(str, TRUE); - field = (struct definition **) &g_ptr_array_index(array->elems, i); + field = (struct bt_definition **) &g_ptr_array_index(array->elems, i); *field = array_declaration->elem->definition_new(array_declaration->elem, array->p.scope, name, i, NULL); @@ -163,7 +163,7 @@ struct definition * error: for (i--; i >= 0; i--) { - struct definition *field; + struct bt_definition *field; field = g_ptr_array_index(array->elems, i); field->declaration->definition_free(field); @@ -176,7 +176,7 @@ error: } static -void _array_definition_free(struct definition *definition) +void _array_definition_free(struct bt_definition *definition) { struct definition_array *array = container_of(definition, struct definition_array, p); @@ -186,7 +186,7 @@ void _array_definition_free(struct definition *definition) (void) g_string_free(array->string, TRUE); if (array->elems) { for (i = 0; i < array->elems->len; i++) { - struct definition *field; + struct bt_definition *field; field = g_ptr_array_index(array->elems, i); field->declaration->definition_free(field); @@ -205,7 +205,7 @@ uint64_t bt_array_len(struct definition_array *array) return array->elems->len; } -struct definition *bt_array_index(struct definition_array *array, uint64_t i) +struct bt_definition *bt_array_index(struct definition_array *array, uint64_t i) { if (!array->elems) return NULL; @@ -214,7 +214,7 @@ struct definition *bt_array_index(struct definition_array *array, uint64_t i) return g_ptr_array_index(array->elems, i); } -int bt_get_array_len(const struct definition *field) +int bt_get_array_len(const struct bt_definition *field) { struct definition_array *array_definition; struct declaration_array *array_declaration; @@ -225,7 +225,7 @@ int bt_get_array_len(const struct definition *field) return array_declaration->len; } -GString *bt_get_char_array(const struct definition *field) +GString *bt_get_char_array(const struct bt_definition *field) { struct definition_array *array_definition; struct declaration_array *array_declaration; diff --git a/types/enum.c b/types/enum.c index 2c0cfe8..e967e14 100644 --- a/types/enum.c +++ b/types/enum.c @@ -41,12 +41,12 @@ #endif static -struct definition *_enum_definition_new(struct declaration *declaration, +struct bt_definition *_enum_definition_new(struct declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index, const char *root_name); static -void _enum_definition_free(struct definition *definition); +void _enum_definition_free(struct bt_definition *definition); static void enum_range_set_free(void *ptr) @@ -417,7 +417,7 @@ struct declaration_enum * } static -struct definition * +struct bt_definition * _enum_definition_new(struct declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index, @@ -426,7 +426,7 @@ struct definition * struct declaration_enum *enum_declaration = container_of(declaration, struct declaration_enum, p); struct definition_enum *_enum; - struct definition *definition_integer_parent; + struct bt_definition *definition_integer_parent; int ret; _enum = g_new(struct definition_enum, 1); @@ -456,7 +456,7 @@ struct definition * } static -void _enum_definition_free(struct definition *definition) +void _enum_definition_free(struct bt_definition *definition) { struct definition_enum *_enum = container_of(definition, struct definition_enum, p); diff --git a/types/float.c b/types/float.c index 16d4352..7aeb9c3 100644 --- a/types/float.c +++ b/types/float.c @@ -32,12 +32,12 @@ #include static -struct definition *_float_definition_new(struct declaration *declaration, +struct bt_definition *_float_definition_new(struct declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index, const char *root_name); static -void _float_definition_free(struct definition *definition); +void _float_definition_free(struct bt_definition *definition); static void _float_declaration_free(struct declaration *declaration) @@ -81,7 +81,7 @@ struct declaration_float * } static -struct definition * +struct bt_definition * _float_definition_new(struct declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index, @@ -90,7 +90,7 @@ struct definition * struct declaration_float *float_declaration = container_of(declaration, struct declaration_float, p); struct definition_float *_float; - struct definition *tmp; + struct bt_definition *tmp; _float = g_new(struct definition_float, 1); bt_declaration_ref(&float_declaration->p); @@ -138,7 +138,7 @@ struct definition * } static -void _float_definition_free(struct definition *definition) +void _float_definition_free(struct bt_definition *definition) { struct definition_float *_float = container_of(definition, struct definition_float, p); diff --git a/types/integer.c b/types/integer.c index 47f23eb..92c7eb1 100644 --- a/types/integer.c +++ b/types/integer.c @@ -33,12 +33,12 @@ #include static -struct definition *_integer_definition_new(struct declaration *declaration, +struct bt_definition *_integer_definition_new(struct declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index, const char *root_name); static -void _integer_definition_free(struct definition *definition); +void _integer_definition_free(struct bt_definition *definition); static void _integer_declaration_free(struct declaration *declaration) @@ -73,7 +73,7 @@ struct declaration_integer * } static -struct definition * +struct bt_definition * _integer_definition_new(struct declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index, @@ -106,7 +106,7 @@ struct definition * } static -void _integer_definition_free(struct definition *definition) +void _integer_definition_free(struct bt_definition *definition) { struct definition_integer *integer = container_of(definition, struct definition_integer, p); @@ -115,7 +115,7 @@ void _integer_definition_free(struct definition *definition) g_free(integer); } -enum ctf_string_encoding bt_get_int_encoding(const struct definition *field) +enum ctf_string_encoding bt_get_int_encoding(const struct bt_definition *field) { struct definition_integer *integer_definition; const struct declaration_integer *integer_declaration; @@ -126,7 +126,7 @@ enum ctf_string_encoding bt_get_int_encoding(const struct definition *field) return integer_declaration->encoding; } -int bt_get_int_base(const struct definition *field) +int bt_get_int_base(const struct bt_definition *field) { struct definition_integer *integer_definition; const struct declaration_integer *integer_declaration; @@ -137,7 +137,7 @@ int bt_get_int_base(const struct definition *field) return integer_declaration->base; } -size_t bt_get_int_len(const struct definition *field) +size_t bt_get_int_len(const struct bt_definition *field) { struct definition_integer *integer_definition; const struct declaration_integer *integer_declaration; @@ -148,7 +148,7 @@ size_t bt_get_int_len(const struct definition *field) return integer_declaration->len; } -int bt_get_int_byte_order(const struct definition *field) +int bt_get_int_byte_order(const struct bt_definition *field) { struct definition_integer *integer_definition; const struct declaration_integer *integer_declaration; @@ -159,7 +159,7 @@ int bt_get_int_byte_order(const struct definition *field) return integer_declaration->byte_order; } -int bt_get_int_signedness(const struct definition *field) +int bt_get_int_signedness(const struct bt_definition *field) { struct definition_integer *integer_definition; const struct declaration_integer *integer_declaration; @@ -170,7 +170,7 @@ int bt_get_int_signedness(const struct definition *field) return integer_declaration->signedness; } -uint64_t bt_get_unsigned_int(const struct definition *field) +uint64_t bt_get_unsigned_int(const struct bt_definition *field) { struct definition_integer *integer_definition; const struct declaration_integer *integer_declaration; @@ -186,7 +186,7 @@ uint64_t bt_get_unsigned_int(const struct definition *field) return (uint64_t)integer_definition->value._signed; } -int64_t bt_get_signed_int(const struct definition *field) +int64_t bt_get_signed_int(const struct bt_definition *field) { struct definition_integer *integer_definition; const struct declaration_integer *integer_declaration; diff --git a/types/sequence.c b/types/sequence.c index a91a249..8792325 100644 --- a/types/sequence.c +++ b/types/sequence.c @@ -32,14 +32,14 @@ #include static -struct definition *_sequence_definition_new(struct declaration *declaration, +struct bt_definition *_sequence_definition_new(struct declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index, const char *root_name); static -void _sequence_definition_free(struct definition *definition); +void _sequence_definition_free(struct bt_definition *definition); -int bt_sequence_rw(struct bt_stream_pos *pos, struct definition *definition) +int bt_sequence_rw(struct bt_stream_pos *pos, struct bt_definition *definition) { struct definition_sequence *sequence_definition = container_of(definition, struct definition_sequence, p); @@ -62,7 +62,7 @@ int bt_sequence_rw(struct bt_stream_pos *pos, struct definition *definition) g_ptr_array_set_size(sequence_definition->elems, len); for (i = oldlen; i < len; i++) { - struct definition **field; + struct bt_definition **field; GString *str; GQuark name; @@ -71,15 +71,15 @@ int bt_sequence_rw(struct bt_stream_pos *pos, struct definition *definition) name = g_quark_from_string(str->str); (void) g_string_free(str, TRUE); - field = (struct definition **) &g_ptr_array_index(sequence_definition->elems, i); + field = (struct bt_definition **) &g_ptr_array_index(sequence_definition->elems, i); *field = sequence_declaration->elem->definition_new(sequence_declaration->elem, sequence_definition->p.scope, name, i, NULL); } for (i = 0; i < len; i++) { - struct definition **field; + struct bt_definition **field; - field = (struct definition **) &g_ptr_array_index(sequence_definition->elems, i); + field = (struct bt_definition **) &g_ptr_array_index(sequence_definition->elems, i); ret = generic_rw(pos, *field); if (ret) return ret; @@ -126,7 +126,7 @@ struct declaration_sequence * } static -struct definition *_sequence_definition_new(struct declaration *declaration, +struct bt_definition *_sequence_definition_new(struct declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index, const char *root_name) @@ -134,7 +134,7 @@ struct definition *_sequence_definition_new(struct declaration *declaration, struct declaration_sequence *sequence_declaration = container_of(declaration, struct declaration_sequence, p); struct definition_sequence *sequence; - struct definition *len_parent; + struct bt_definition *len_parent; int ret; sequence = g_new(struct definition_sequence, 1); @@ -198,18 +198,18 @@ error: } static -void _sequence_definition_free(struct definition *definition) +void _sequence_definition_free(struct bt_definition *definition) { struct definition_sequence *sequence = container_of(definition, struct definition_sequence, p); - struct definition *len_definition = &sequence->length->p; + struct bt_definition *len_definition = &sequence->length->p; uint64_t i; if (sequence->string) (void) g_string_free(sequence->string, TRUE); if (sequence->elems) { for (i = 0; i < sequence->elems->len; i++) { - struct definition *field; + struct bt_definition *field; field = g_ptr_array_index(sequence->elems, i); field->declaration->definition_free(field); @@ -227,7 +227,7 @@ uint64_t bt_sequence_len(struct definition_sequence *sequence) return sequence->length->value._unsigned; } -struct definition *bt_sequence_index(struct definition_sequence *sequence, uint64_t i) +struct bt_definition *bt_sequence_index(struct definition_sequence *sequence, uint64_t i) { if (!sequence->elems) return NULL; diff --git a/types/string.c b/types/string.c index dff27ee..5db1716 100644 --- a/types/string.c +++ b/types/string.c @@ -32,12 +32,12 @@ #include static -struct definition *_string_definition_new(struct declaration *declaration, +struct bt_definition *_string_definition_new(struct declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index, const char *root_name); static -void _string_definition_free(struct definition *definition); +void _string_definition_free(struct bt_definition *definition); static void _string_declaration_free(struct declaration *declaration) @@ -64,7 +64,7 @@ struct declaration_string * } static -struct definition * +struct bt_definition * _string_definition_new(struct declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index, @@ -99,7 +99,7 @@ struct definition * } static -void _string_definition_free(struct definition *definition) +void _string_definition_free(struct bt_definition *definition) { struct definition_string *string = container_of(definition, struct definition_string, p); @@ -109,7 +109,7 @@ void _string_definition_free(struct definition *definition) g_free(string); } -enum ctf_string_encoding bt_get_string_encoding(const struct definition *field) +enum ctf_string_encoding bt_get_string_encoding(const struct bt_definition *field) { struct definition_string *string_definition; const struct declaration_string *string_declaration; @@ -120,7 +120,7 @@ enum ctf_string_encoding bt_get_string_encoding(const struct definition *field) return string_declaration->encoding; } -char *bt_get_string(const struct definition *field) +char *bt_get_string(const struct bt_definition *field) { struct definition_string *string_definition = container_of(field, struct definition_string, p); diff --git a/types/struct.c b/types/struct.c index 219d523..fadc187 100644 --- a/types/struct.c +++ b/types/struct.c @@ -36,14 +36,14 @@ #endif static -struct definition *_struct_definition_new(struct declaration *declaration, +struct bt_definition *_struct_definition_new(struct declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index, const char *root_name); static -void _struct_definition_free(struct definition *definition); +void _struct_definition_free(struct bt_definition *definition); -int bt_struct_rw(struct bt_stream_pos *ppos, struct definition *definition) +int bt_struct_rw(struct bt_stream_pos *ppos, struct bt_definition *definition) { struct definition_struct *struct_definition = container_of(definition, struct definition_struct, p); @@ -51,7 +51,7 @@ int bt_struct_rw(struct bt_stream_pos *ppos, struct definition *definition) int ret; for (i = 0; i < struct_definition->fields->len; i++) { - struct definition *field = + struct bt_definition *field = g_ptr_array_index(struct_definition->fields, i); ret = generic_rw(ppos, field); if (ret) @@ -105,7 +105,7 @@ struct declaration_struct * } static -struct definition * +struct bt_definition * _struct_definition_new(struct declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index, @@ -141,8 +141,8 @@ struct definition * struct declaration_field *declaration_field = &g_array_index(struct_declaration->fields, struct declaration_field, i); - struct definition **field = - (struct definition **) &g_ptr_array_index(_struct->fields, i); + struct bt_definition **field = + (struct bt_definition **) &g_ptr_array_index(_struct->fields, i); *field = declaration_field->declaration->definition_new(declaration_field->declaration, _struct->p.scope, @@ -154,7 +154,7 @@ struct definition * error: for (i--; i >= 0; i--) { - struct definition *field = g_ptr_array_index(_struct->fields, i); + struct bt_definition *field = g_ptr_array_index(_struct->fields, i); bt_definition_unref(field); } bt_free_definition_scope(_struct->p.scope); @@ -164,7 +164,7 @@ error: } static -void _struct_definition_free(struct definition *definition) +void _struct_definition_free(struct bt_definition *definition) { struct definition_struct *_struct = container_of(definition, struct definition_struct, p); @@ -172,7 +172,7 @@ void _struct_definition_free(struct definition *definition) assert(_struct->fields->len == _struct->declaration->fields->len); for (i = 0; i < _struct->fields->len; i++) { - struct definition *field = g_ptr_array_index(_struct->fields, i); + struct bt_definition *field = g_ptr_array_index(_struct->fields, i); bt_definition_unref(field); } bt_free_definition_scope(_struct->p.scope); @@ -241,7 +241,7 @@ struct declaration_field * /* * field returned only valid as long as the field structure is not appended to. */ -struct definition * +struct bt_definition * bt_struct_definition_get_field_from_index(struct definition_struct *_struct, int index) { diff --git a/types/types.c b/types/types.c index 3e20dfe..b235c13 100644 --- a/types/types.c +++ b/types/types.c @@ -92,7 +92,7 @@ int bt_register_declaration(GQuark name, struct declaration *declaration, } static -struct definition * +struct bt_definition * lookup_field_definition_scope(GQuark field_name, struct definition_scope *scope) { @@ -158,7 +158,7 @@ end: } static struct definition_scope * - get_definition_scope(const struct definition *definition) + get_definition_scope(const struct bt_definition *definition) { return definition->scope; } @@ -183,12 +183,12 @@ static struct definition_scope * * lookup_path: the path leading to the enum we want to look for. * scope: the definition scope containing the variant definition. */ -struct definition * +struct bt_definition * bt_lookup_path_definition(GArray *cur_path, GArray *lookup_path, struct definition_scope *scope) { - struct definition *definition, *lookup_definition; + struct bt_definition *definition, *lookup_definition; GQuark last; int index; @@ -262,7 +262,7 @@ lookup: return NULL; } -int bt_register_field_definition(GQuark field_name, struct definition *definition, +int bt_register_field_definition(GQuark field_name, struct bt_definition *definition, struct definition_scope *scope) { if (!scope || !field_name) @@ -292,12 +292,12 @@ void bt_declaration_unref(struct declaration *declaration) declaration->declaration_free(declaration); } -void bt_definition_ref(struct definition *definition) +void bt_definition_ref(struct bt_definition *definition) { definition->ref++; } -void bt_definition_unref(struct definition *definition) +void bt_definition_unref(struct bt_definition *definition) { if (!definition) return; @@ -612,7 +612,7 @@ void bt_free_definition_scope(struct definition_scope *scope) g_free(scope); } -struct definition *bt_lookup_definition(const struct definition *definition, +struct bt_definition *bt_lookup_definition(const struct bt_definition *definition, const char *field_name) { struct definition_scope *scope = get_definition_scope(definition); @@ -624,11 +624,11 @@ struct definition *bt_lookup_definition(const struct definition *definition, scope); } -struct definition_integer *bt_lookup_integer(const struct definition *definition, +struct definition_integer *bt_lookup_integer(const struct bt_definition *definition, const char *field_name, int signedness) { - struct definition *lookup; + struct bt_definition *lookup; struct definition_integer *lookup_integer; lookup = bt_lookup_definition(definition, field_name); @@ -642,11 +642,11 @@ struct definition_integer *bt_lookup_integer(const struct definition *definition return lookup_integer; } -struct definition_enum *bt_lookup_enum(const struct definition *definition, +struct definition_enum *bt_lookup_enum(const struct bt_definition *definition, const char *field_name, int signedness) { - struct definition *lookup; + struct bt_definition *lookup; struct definition_enum *lookup_enum; lookup = bt_lookup_definition(definition, field_name); @@ -660,10 +660,10 @@ struct definition_enum *bt_lookup_enum(const struct definition *definition, return lookup_enum; } -struct definition *bt_lookup_variant(const struct definition *definition, +struct bt_definition *bt_lookup_variant(const struct bt_definition *definition, const char *field_name) { - struct definition *lookup; + struct bt_definition *lookup; struct definition_variant *bt_lookup_variant; lookup = bt_lookup_definition(definition, field_name); diff --git a/types/variant.c b/types/variant.c index 4db0de9..ed29550 100644 --- a/types/variant.c +++ b/types/variant.c @@ -32,18 +32,18 @@ #include static -struct definition *_variant_definition_new(struct declaration *declaration, +struct bt_definition *_variant_definition_new(struct declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index, const char *root_name); static -void _variant_definition_free(struct definition *definition); +void _variant_definition_free(struct bt_definition *definition); -int bt_variant_rw(struct bt_stream_pos *ppos, struct definition *definition) +int bt_variant_rw(struct bt_stream_pos *ppos, struct bt_definition *definition) { struct definition_variant *variant_definition = container_of(definition, struct definition_variant, p); - struct definition *field; + struct bt_definition *field; field = bt_variant_get_current_field(variant_definition); return generic_rw(ppos, field); @@ -130,7 +130,7 @@ struct declaration_variant * */ static int check_enum_tag(struct definition_variant *variant, - struct definition *enum_tag) + struct bt_definition *enum_tag) { struct definition_enum *_enum = container_of(enum_tag, struct definition_enum, p); @@ -172,7 +172,7 @@ int check_enum_tag(struct definition_variant *variant, static -struct definition * +struct bt_definition * _variant_definition_new(struct declaration *declaration, struct definition_scope *parent_scope, GQuark field_name, int index, @@ -216,8 +216,8 @@ struct definition * struct declaration_field *declaration_field = &g_array_index(variant_declaration->untagged_variant->fields, struct declaration_field, i); - struct definition **field = - (struct definition **) &g_ptr_array_index(variant->fields, i); + struct bt_definition **field = + (struct bt_definition **) &g_ptr_array_index(variant->fields, i); /* * All child definition are at index 0, because they are @@ -239,7 +239,7 @@ error: } static -void _variant_definition_free(struct definition *definition) +void _variant_definition_free(struct bt_definition *definition) { struct definition_variant *variant = container_of(definition, struct definition_variant, p); @@ -247,7 +247,7 @@ void _variant_definition_free(struct definition *definition) assert(variant->fields->len == variant->declaration->untagged_variant->fields->len); for (i = 0; i < variant->fields->len; i++) { - struct definition *field = g_ptr_array_index(variant->fields, i); + struct bt_definition *field = g_ptr_array_index(variant->fields, i); bt_definition_unref(field); } bt_definition_unref(variant->enum_tag); @@ -301,7 +301,7 @@ bt_untagged_variant_declaration_get_field_from_tag(struct declaration_untagged_v /* * field returned only valid as long as the field structure is not appended to. */ -struct definition *bt_variant_get_current_field(struct definition_variant *variant) +struct bt_definition *bt_variant_get_current_field(struct definition_variant *variant) { struct definition_enum *_enum = container_of(variant->enum_tag, struct definition_enum, p); -- 1.7.10.4 From mathieu.desnoyers at efficios.com Fri Feb 15 14:28:19 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 15 Feb 2013 14:28:19 -0500 Subject: [lttng-dev] [BABELTRACE PATCH 1/7] Namespace compliance for dependencies function In-Reply-To: <1360948976-14999-1-git-send-email-jdesfossez@efficios.com> References: <1360948976-14999-1-git-send-email-jdesfossez@efficios.com> Message-ID: <20130215192819.GA16741@Krystal> * Julien Desfossez (jdesfossez at efficios.com) wrote: > Use the bt_ prefix instead of babeltrace_ patches 1 to 7 merged, thanks ! Mathieu > > Signed-off-by: Julien Desfossez > --- > formats/ctf/callbacks.c | 6 +++--- > include/babeltrace/ctf/callbacks.h | 4 ++-- > 2 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/formats/ctf/callbacks.c b/formats/ctf/callbacks.c > index 71e3248..793f3d3 100644 > --- a/formats/ctf/callbacks.c > +++ b/formats/ctf/callbacks.c > @@ -38,7 +38,7 @@ > #include > > static > -struct bt_dependencies *_babeltrace_dependencies_create(const char *first, > +struct bt_dependencies *_bt_dependencies_create(const char *first, > va_list ap) > { > const char *iter; > @@ -56,13 +56,13 @@ struct bt_dependencies *_babeltrace_dependencies_create(const char *first, > return dep; > } > > -struct bt_dependencies *babeltrace_dependencies_create(const char *first, ...) > +struct bt_dependencies *bt_dependencies_create(const char *first, ...) > { > va_list ap; > struct bt_dependencies *deps; > > va_start(ap, first); > - deps = _babeltrace_dependencies_create(first, ap); > + deps = _bt_dependencies_create(first, ap); > va_end(ap); > return deps; > } > diff --git a/include/babeltrace/ctf/callbacks.h b/include/babeltrace/ctf/callbacks.h > index c178767..bc75769 100644 > --- a/include/babeltrace/ctf/callbacks.h > +++ b/include/babeltrace/ctf/callbacks.h > @@ -51,13 +51,13 @@ enum bt_cb_ret { > /* > * Receives a variable number of strings as parameter, ended with NULL. > */ > -struct bt_dependencies *babeltrace_dependencies_create(const char *first, ...); > +struct bt_dependencies *bt_dependencies_create(const char *first, ...); > > /* > * struct bt_dependencies must be destroyed explicitly if not passed as > * parameter to a bt_ctf_iter_add_callback(). > */ > -void babeltrace_dependencies_destroy(struct bt_dependencies *dep); > +void bt_dependencies_destroy(struct bt_dependencies *dep); > > /* > * bt_ctf_iter_add_callback: Add a callback to iterator. > -- > 1.7.10.4 > -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From christian.babeux at efficios.com Fri Feb 15 15:36:11 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Fri, 15 Feb 2013 15:36:11 -0500 Subject: [lttng-dev] Using lttng-ust's libringbuffer outside lttng-ust In-Reply-To: <511A9E5A.4010303@redhat.com> References: <511A9E5A.4010303@redhat.com> Message-ID: Hi David, > Over in systemtap land, we're working on implementing a pure userspace > backend, using a project called dyninst (). This project looks very interesting! > Assuming it does make sense, I could use some help. Is there any > documentation that I've missed somewhere that describes libringbuffer in > any detail? I found some old presentation that Mathieu did a Linuxcon in 2010 [1]. The presentation describe the unified kernel ringbuffer on which the user space one is based. I'm afraid that if you want up-to-date documentation, the source code will be the best place to look. > The next question would be what is the best way of using libringbuffer > outside lttng-ust. One (not great) possibility would be to just copy the > code into systemtap. Of course the problem there is keeping the code up > to date with changes in lttng-ust. The next possibility would be to make > it a separate project (more like userspace-rcu). Splitting libringbuffer from the UST tree right now would prove to be quite a challenge. We would need to expose an API to the "clients" of the ringbuffer. Currently there are two levels of abstraction that one can use with the ringbuffer: a "high-level" one where you use a predefined "client" with the associated performance degradation and a "low-level" one where you know exactly which kind of "client" you are using with the associated fast-path inlined. We would need to discuss which level of abstraction we expose to the user: a generic one or "N apis" for the different low-level "clients". With that said, I'm curious about which specific features of Dyninst SystemTAP will be using and also do you think that it would be possible to integrate Dyninst as an additional instrumentation source into lttng-ust? Thanks, Christian [1] - A new unified Lockless Ring Buffer library for efficient kernel tracing: http://www.efficios.com/pub/linuxcon2010-tracingsummit/presentation-linuxcon-2010-tracing-mini-summit.pdf From jeremie.galarneau at efficios.com Fri Feb 15 20:46:45 2013 From: jeremie.galarneau at efficios.com (=?UTF-8?q?J=C3=A9r=C3=A9mie=20Galarneau?=) Date: Fri, 15 Feb 2013 20:46:45 -0500 Subject: [lttng-dev] [PATCH lttng-tools] Fix: mark generated python bindings files as nodist Message-ID: <1360979205-20346-1-git-send-email-jeremie.galarneau@efficios.com> make dist would fail if ./configure had not been invoked with the --enable-python-bindings switch. Signed-off-by: J?r?mie Galarneau --- extras/bindings/swig/python/Makefile.am | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/extras/bindings/swig/python/Makefile.am b/extras/bindings/swig/python/Makefile.am index c6a6901..6e7baa6 100644 --- a/extras/bindings/swig/python/Makefile.am +++ b/extras/bindings/swig/python/Makefile.am @@ -4,16 +4,14 @@ lttng.i: lttng.i.in AM_CFLAGS = -I$(PYTHON_INCLUDE) -I$(top_srcdir)/lib/lttng-ctl -I../common \ $(BUDDY_CFLAGS) -EXTRA_DIST = lttng.i -python_PYTHON = lttng.py +EXTRA_DIST = lttng.i.in +nodist_python_PYTHON = lttng.py pyexec_LTLIBRARIES = _lttng.la MAINTAINERCLEANFILES = lttng_wrap.c lttng.py -_lttng_la_SOURCES = lttng_wrap.c - +nodist__lttng_la_SOURCES = lttng_wrap.c _lttng_la_LDFLAGS = -module - _lttng_la_LIBADD = $(top_srcdir)/src/lib/lttng-ctl/liblttng-ctl.la \ $(top_srcdir)/src/common/sessiond-comm/libsessiond-comm.la -- 1.8.1.1 From jistone at redhat.com Fri Feb 15 22:43:55 2013 From: jistone at redhat.com (Josh Stone) Date: Fri, 15 Feb 2013 19:43:55 -0800 Subject: [lttng-dev] Using lttng-ust's libringbuffer outside lttng-ust In-Reply-To: References: <511A9E5A.4010303@redhat.com> Message-ID: <511F007B.9020701@redhat.com> On 02/15/2013 12:36 PM, Christian Babeux wrote: > With that said, I'm curious about which specific features of Dyninst > SystemTAP will be using and also do you think that it would be > possible to integrate Dyninst as an additional instrumentation source > into lttng-ust? We're using Dyninst mainly like a pure-userspace form of uprobes, so we can instrument a process without any direct kernel involvement. In this mode, stap is perfectly fine for unprivileged users (on their own processes), and it can be faster too since it's running instrumentation directly in-process (versus uprobes' breakpoint trap). Like uprobes, these instrumentation points can be anywhere in the process. And sure, I can definitely see lttng using it for similar reasons. We've already packaged Dyninst in Fedora, if you'd like to try it out. Josh From Paul_Woegerer at mentor.com Mon Feb 18 03:47:22 2013 From: Paul_Woegerer at mentor.com (Woegerer, Paul) Date: Mon, 18 Feb 2013 09:47:22 +0100 Subject: [lttng-dev] How to disable an event that's been enabled by a wildcard selection or -a? In-Reply-To: <20998D40D9A2B7499CA5A3A2666CB1EB19F968AF@ZURMSG1.QUANTUM.com> References: <009B25148989C6458484484699278506985C0CFA@EU-MBX-01.mgc.mentorg.com> <20998D40D9A2B7499CA5A3A2666CB1EB19F968AF@ZURMSG1.QUANTUM.com> Message-ID: <5121EA9A.8080905@mentor.com> Hi David, On 02/14/2013 05:52 AM, David OShea wrote: > Hi, > > My understanding (hopefully someone will correct me if I'm wrong) is that each time you invoke 'lttng enable-event', your specification for the events you want enabled is stored and applied, and/or potentially applied later if a new application connects to the session daemon. All 'lttng disable-event' does is remove one of the specifications you previously provided to 'lttng enable-event', so you can't say 'enable-event *' and then 'disable-event foo:*' to get all events except 'foo:*'. > > If you could constrain the application to use a particular trace provider name for all of its tracepoints, say "app", then you could just do 'lttng enable-event app:*'. If you can't do that, then I think you need to fall back on getting a list of all the available tracepoints using 'lttng list -u', parsing this to find all of the available tracepoints, extracting the trace provider name from them, then using 'lttng enable-event :*' for each provider other than the provider from your uninteresting library. I think there are APIs that can be used instead of issuing the 'lttng' commands. > > I would certainly also like a way to be able to, say, enable all events other than foo:* and bar:* using one command. I submitted a patch that does exactly this a while ago: http://lists.lttng.org/pipermail/lttng-dev/2012-June/018179.html Although it's not upstream it works well for us. Thanks, Paul > > Regards, > David > >> -----Original Message----- >> From: Ikaheimonen, JP [mailto:jp_ikaheimonen at mentor.com] >> Sent: Friday, 8 February 2013 7:56 PM >> To: lttng-dev at lists.lttng.org >> Subject: [lttng-dev] How to disable an event that's been enabled by a >> wildcard selection or -a? >> >> Consider the following scenario. >> I want to write a script that traces all UST tracepoints of a given >> application. I have no idea what the names of these tracepoints are. >> Also, I know that the application uses a library that contains some >> tracepoints I am not interested about. Now I want to trace all UST >> tracepoints except the ones I already know about. Is this possible with >> the lttng commands? >> >> If I enable all tracepoints with "lttng enable-event -u -a" I get all >> events, even those I do not want. I've tried using "lttng disable- >> event", and "lttng enable-event" with a filter, but I cannot seem to be >> able to get rid of the specific events. >> >> Thank you, >> >> JP Ikaheimonen >> Mentor Graphics Embedded Systems Division >> Nucleus(r) | Linux(r) | Android(tm) | Services | UI | Multi-OS >> >> Android is a trademark of Google Inc. Use of this trademark is subject >> to Google Permissions. >> Linux is the registered trademark of Linus Torvalds in the U.S. and >> other countries. >> >> _______________________________________________ >> lttng-dev mailing list >> lttng-dev at lists.lttng.org >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > ---------------------------------------------------------------------- > The information contained in this transmission may be confidential. Any disclosure, copying, or further distribution of confidential information is not permitted unless such privilege is explicitly granted in writing by Quantum. Quantum reserves the right to have electronic communications, including email and attachments, sent across its networks filtered through anti virus and spam software programs and retain such messages in order to comply with applicable data security and retention requirements. Quantum is not responsible for the proper and complete transmission of the substance of this communication or for any delay in its receipt. > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > -- Paul Woegerer | SW Development Engineer http://go.mentor.com/sourceryanalyzer Mentor Embedded(tm) | Prinz Eugen Stra?e 72/2/4, Vienna, 1040 Austria Nucleus? | Linux? | Android(tm) | Services | UI | Multi-OS Android is a trademark of Google Inc. Use of this trademark is subject to Google Permissions. Linux is the registered trademark of Linus Torvalds in the U.S. and other countries. From Andrew_Gabbasov at mentor.com Mon Feb 18 05:14:46 2013 From: Andrew_Gabbasov at mentor.com (Gabbasov, Andrew) Date: Mon, 18 Feb 2013 10:14:46 +0000 Subject: [lttng-dev] LTTng: global_dirty_limit symbol lookup failed In-Reply-To: <20130125172448.GA694@Krystal> References: <20130125172448.GA694@Krystal> Message-ID: <6C5EA58090A5ED459815C4D04C2B466F8C56DAF3@EU-MBX-01.mgc.mentorg.com> > Hi Andrew, > > Commit: > > commit b87700e318c27267890cbd6fb5e50b687279131b > Author: Andrew Gabbasov > Date: Mon Dec 10 11:14:52 2012 -0500 > > Add new kernel probes instrumentation > > Add kernel probes for btrfs, compaction, ext4, printk, random, rcu, > regmap, rpm, sunrpc, workqueue, writeback. > > Signed-off-by: Andrew Gabbasov > Signed-off-by: Mathieu Desnoyers > > has 2 issues: > > 1) it implements a wrapper around global_dirty_limit() in probes/. All > wrappers should be in /wrapper/, without exception, otherwise the > code will quickly become unmaintainable (we need to know what > wrappers we can eventually remove if we remove support for older > kernels in the future, and we need to be aware of those wrappers for > complete testing coverage). I have no problem with having a > probes/Makefile using a relative path (e.g. ../wrapper/somefile.o) as > input if needed. > > 2) It fills my dmesg log output with: > "LTTng: global_dirty_limit symbol lookup failed." > messages. .config follows. > > Can you look into those issues ? > > Thanks, > > Mathieu Hi Mathieu, Sorry for a late response. I'm sending a separate e-mail with the patch to fix these issues. Here are some details: 1) I moved the wrapper to a separate file wrapper/writeback.h. Since it is supposed to be used in writeback probe only, I think, using static variable will be harmless. 2) Since global_dirty_limit is not a function, but a global variable, its address is available to kallsyms lookup only if CONFIG_KALLSYMS_ALL is set. In order not to introduce wrapper related checks of this config into tracepoint definition include file, I decided not to exclude separate tracepoints in case of this config absence, but to omit the whole probe from building. So, writeback probe will be available only if CONFIG_KALLSYMS_ALL is set. 3) Additional issue that I noticed: in case of CONFIG_THUMB2_KERNEL setting for ARM, kallsyms_lookup_funcptr modifies the address found for the symbol. In order to avoid it for data addresses, I introduced a new kallsyms_lookup_dataptr function, that does not do any address modifications. And this new function is used for global_dirty_limit wrapper. Thanks. Best regards, Andrew From andrew_gabbasov at mentor.com Mon Feb 18 05:17:26 2013 From: andrew_gabbasov at mentor.com (Andrew Gabbasov) Date: Mon, 18 Feb 2013 04:17:26 -0600 Subject: [lttng-dev] [PATCH lttng-modules] Clean up using global_dirty_limit wrapper for writeback probe Message-ID: <1361182646-31794-1-git-send-email-andrew_gabbasov@mentor.com> Move the wrapper around reading of global_dirty_limit to /wrapper/ directory. Introduce a new kallsyms_lookup_dataptr function for obtaining the address unchanged and use it in global_dirty_limit wrapper. Since the data address is available only if CONFIG_KALLSYMS_ALL is set, omit the whole probe from building if this config is missing. Signed-off-by: Andrew Gabbasov --- probes/Makefile | 2 ++ probes/lttng-probe-writeback.c | 19 ++----------- wrapper/kallsyms.h | 6 ++++ wrapper/writeback.h | 61 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 71 insertions(+), 17 deletions(-) create mode 100644 wrapper/writeback.h diff --git a/probes/Makefile b/probes/Makefile index 088cd5f..08adad5 100644 --- a/probes/Makefile +++ b/probes/Makefile @@ -189,10 +189,12 @@ endif obj-m += lttng-probe-workqueue.o +ifneq ($(CONFIG_KALLSYMS_ALL),) obj-m += $(shell \ if [ $(VERSION) -ge 3 \ -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 36 \) ] ; then \ echo "lttng-probe-writeback.o" ; fi;) +endif ifneq ($(CONFIG_KPROBES),) diff --git a/probes/lttng-probe-writeback.c b/probes/lttng-probe-writeback.c index 0a5c022..5e421e5 100644 --- a/probes/lttng-probe-writeback.c +++ b/probes/lttng-probe-writeback.c @@ -32,27 +32,12 @@ #include #include "../lttng-kernel-version.h" +#include "../wrapper/writeback.h" /* #if */ -#ifdef CONFIG_KALLSYMS -#include "../wrapper/kallsyms.h" -static unsigned long *wrapper_global_dirty_limit_sym = 0; -static inline -unsigned long wrapper_global_dirty_limit(void) -{ - if (!wrapper_global_dirty_limit_sym) - wrapper_global_dirty_limit_sym = - (void *)kallsyms_lookup_funcptr("global_dirty_limit"); - if (wrapper_global_dirty_limit_sym) - return *wrapper_global_dirty_limit_sym; - else { - printk(KERN_WARNING "LTTng: global_dirty_limit symbol lookup failed.\n"); - return 0; - } -} #define global_dirty_limit wrapper_global_dirty_limit() -#endif + /* #endif */ /* diff --git a/wrapper/kallsyms.h b/wrapper/kallsyms.h index f07788a..ad9e1f2 100644 --- a/wrapper/kallsyms.h +++ b/wrapper/kallsyms.h @@ -42,4 +42,10 @@ unsigned long kallsyms_lookup_funcptr(const char *name) #endif return addr; } + +static inline +unsigned long kallsyms_lookup_dataptr(const char *name) +{ + return kallsyms_lookup_name(name); +} #endif /* _LTTNG_WRAPPER_KALLSYMS_H */ diff --git a/wrapper/writeback.h b/wrapper/writeback.h new file mode 100644 index 0000000..818ddd6 --- /dev/null +++ b/wrapper/writeback.h @@ -0,0 +1,61 @@ +#ifndef _LTTNG_WRAPPER_WRITEBACK_H +#define _LTTNG_WRAPPER_WRITEBACK_H + +/* + * wrapper/writeback.h + * + * wrapper around global_dirty_limit read. Using KALLSYMS with KALLSYMS_ALL + * to get its address when available, else we need to have a kernel that + * exports this variable to GPL modules. + * + * Copyright (C) 2013 Mentor Graphics Corp. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; only + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifdef CONFIG_KALLSYMS_ALL + +#include +#include "kallsyms.h" + +static unsigned long *global_dirty_limit_sym = 0; + +static inline +unsigned long wrapper_global_dirty_limit(void) +{ + if (!global_dirty_limit_sym) + global_dirty_limit_sym = + (void *)kallsyms_lookup_dataptr("global_dirty_limit"); + if (global_dirty_limit_sym) + return *global_dirty_limit_sym; + else { + printk(KERN_WARNING "LTTng: global_dirty_limit symbol lookup failed.\n"); + return 0; + } +} + +#else + +#include + +static inline +unsigned long wrapper_global_dirty_limit(void) +{ + return global_dirty_limit; +} + +#endif + +#endif /* _LTTNG_WRAPPER_WRITEBACK_H */ -- 1.7.10.4 From vivekkumar.p at gmail.com Mon Feb 18 05:56:38 2013 From: vivekkumar.p at gmail.com (Vivek Kumar) Date: Mon, 18 Feb 2013 16:26:38 +0530 Subject: [lttng-dev] Issue faced in logging the traces In-Reply-To: <511E463F.2080605@efficios.com> References: <511E463F.2080605@efficios.com> Message-ID: Hi David, Thanks for the response. LTTng-ust is also ported. Please find attached the PPT where I have taken the snaps and described the issue faced. At present I am trying to port and instrument LTTng for userspace only. My SoC is ARM-Cortex A9 from Mindspeed and the os is openWRT Linux. LTTng doesn't report any issue when I run it to instrument in userspace but CTF is not logged in the Home directory, please take a look to the powerpoint slides for descriptions and commands that I give. Regards, Vivek On Fri, Feb 15, 2013 at 7:59 PM, David Goulet wrote: > Hi Vivek, > > In order to collect a trace you need to instrument your application with > LTTng-UST tracepoints. > > If you like to gather the syscalls for instance, you need to install the > LTTng modules and start your session daemon as root. > > If you are still experiencing problem, please provide the commands you > use and setup. > > Thanks! > David > > Vivek Kumar: > > Hi, > > > > I am trying to port LTTng to my arm based board. > > For userspace tracing, I have been able to successfully port followings: > > LTTng-tools, > > LTT-ust Library > > Userspace-rcu > > libpopt > > > > Now I can see that lttng-sessiond is running, and am able to create > > sessions, enable-event and start and stop tracing. > > But, I don't see traces be logged in the home directory (indeed nothing > > happens, i.e, not even the creation of the base directory -> > lttng-traces). > > Am I missing anything because of that LTTng is failing to log traces? > > Please help. > > > > Regards, Vivek > > > > > > -- > > Best, Vivek > > > > > > This body part will be downloaded on demand. > -- Best, Vivek -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: LTTng-Port.pptx Type: application/vnd.openxmlformats-officedocument.presentationml.presentation Size: 548561 bytes Desc: not available URL: From mathieu.desnoyers at efficios.com Mon Feb 18 09:03:02 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Mon, 18 Feb 2013 09:03:02 -0500 Subject: [lttng-dev] liburcu-bp not found In-Reply-To: References: Message-ID: <20130218140302.GA2606@Krystal> * Vanni Genua (vannigenua at gmail.com) wrote: > Hi Mathieu, > After a long time, I decided to install LTTng on Intel Atom Z530 too. > My kernel: 3.6.2-rt4 > My instruction set:x86 > My Linux distro:gentoo. > After having installed glibc, uuidtools, automake, autoconf, libtools, I > tried to install LTTng this way, getting some errors as reported below: > CCing lttng-dev. Please contact lttng-dev at lists.lttng.org with these issues, so that other LTTng developers can help you out. Thanks, Mathieu > STEP1: > #git clone http://git.lttng.org/lttng-modules.git > > #cd lttng-modules > > lttng-modules # make > make -C /lib/modules/3.6.2-rt4/build M=/usr/src/LTTng/lttng-modules modules > make[1]: Entering directory `/usr/src/linux-3.6.2-rt4' > Building modules, stage 2. > MODPOST 0 modules > make[1]: Leaving directory `/usr/src/linux-3.6.2-rt4' > > lttng-modules # make modules_install > make -C /lib/modules/3.6.2-rt4/build M=/usr/src/LTTng/lttng-modules > modules_install > make[1]: Entering directory `/usr/src/linux-3.6.2-rt4' > DEPMOD 3.6.2-rt4 > make[1]: Leaving directory `/usr/src/linux-3.6.2-rt4' > > lttng-modules # depmod -a > > STEP2: > # git clone http://git.lttng.org/userspace-rcu.git > > #cd userspace-rcu > userspace-rcu # ./bootstrap > userspace-rcu # ./configure > checking build system type... i686-pc-linux-gnu > checking host system type... i686-pc-linux-gnu > checking target system type... i686-pc-linux-gnu > checking for a BSD-compatible install... /usr/bin/install -c > checking whether build environment is sane... yes > checking for a thread-safe mkdir -p... /bin/mkdir -p > checking for gawk... gawk > checking whether make sets $(MAKE)... yes > checking for style of include used by make... GNU > checking for gcc... gcc > checking whether the C compiler works... yes > checking for C compiler default output file name... a.out > checking for suffix of executables... > checking whether we are cross compiling... no > checking for suffix of object files... o > checking whether we are using the GNU C compiler... yes > checking whether gcc accepts -g... yes > checking for gcc option to accept ISO C89... none needed > checking dependency style of gcc... gcc3 > checking for thread local storage (TLS) class... __thread > checking for gcc... (cached) gcc > checking whether we are using the GNU C compiler... (cached) yes > checking whether gcc accepts -g... (cached) yes > checking for gcc option to accept ISO C89... (cached) none needed > checking dependency style of gcc... (cached) gcc3 > checking whether make sets $(MAKE)... (cached) yes > checking how to print strings... printf > checking for a sed that does not truncate output... /bin/sed > checking for grep that handles long lines and -e... /bin/grep > checking for egrep... /bin/grep -E > checking for fgrep... /bin/grep -F > checking for ld used by gcc... /usr/i686-pc-linux-gnu/bin/ld > checking if the linker (/usr/i686-pc-linux-gnu/bin/ld) is GNU ld... yes > checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B > checking the name lister (/usr/bin/nm -B) interface... BSD nm > checking whether ln -s works... yes > checking the maximum length of command line arguments... 1572864 > checking whether the shell understands some XSI constructs... yes > checking whether the shell understands "+="... yes > checking for /usr/i686-pc-linux-gnu/bin/ld option to reload object files... > -r > checking for objdump... objdump checking how to recognize dependent > libraries... pass_all > checking for ar... ar > checking for strip... strip > checking for ranlib... ranlib > checking command to parse /usr/bin/nm -B output from gcc object... ok > checking how to run the C preprocessor... gcc -E > checking for ANSI C header files... yes > checking for sys/types.h... yes > checking for sys/stat.h... yes > checking for stdlib.h... yes > checking for string.h... yes > checking for memory.h... yes > checking for strings.h... yes > checking for inttypes.h... yes > checking for stdint.h... yes > checking for unistd.h... yes > checking for dlfcn.h... yes > checking for objdir... .libs > checking if gcc supports -fno-rtti -fno-exceptions... no > checking for gcc option to produce PIC... -fPIC -DPIC > checking if gcc PIC flag -fPIC -DPIC works... yes > checking if gcc static flag -static works... yes > checking if gcc supports -c -o file.o... yes > checking if gcc supports -c -o file.o... (cached) yes > checking whether the gcc linker (/usr/i686-pc-linux-gnu/bin/ld) supports > shared libraries... yes > checking whether -lc should be explicitly linked in... no > checking dynamic linker characteristics... GNU/Linux ld.so > checking how to hardcode library paths into programs... immediate > checking whether stripping libraries is possible... yes > checking if libtool supports shared libraries... yes > checking whether to build shared libraries... yes > checking whether to build static libraries... yes > checking for inline... inline > checking for pid_t... yes > checking for size_t... yes > checking for stdlib.h... (cached) yes > checking for GNU libc compatible malloc... yes > checking for stdlib.h... (cached) yes > checking for unistd.h... (cached) yes > checking for sys/param.h... yes > checking for getpagesize... yes > checking for working mmap... yes > checking for bzero... yes > checking for gettimeofday... yes > checking for munmap... yes > checking for sched_getcpu... yes > checking for strtoul... yes > checking for sysconf... yes > checking if architecture really supports the mfence instruction... no > checking for sys_futex()... yes > checking for sched_setaffinity... yes > checking for cpu_set_t... yes > checking whether CPU_ZERO works... yes > checking how many arguments sched_setaffinity takes... 3 > configure: creating ./config.status > config.status: creating Makefile > config.status: creating doc/Makefile > config.status: creating tests/Makefile > config.status: creating liburcu.pc > config.status: creating liburcu-bp.pc > config.status: creating liburcu-cds.pc > config.status: creating liburcu-qsbr.pc > config.status: creating liburcu-mb.pc > config.status: creating liburcu-signal.pc > config.status: creating config.h > config.status: config.h is unchanged > config.status: creating urcu/config.h > config.status: urcu/config.h is unchanged > config.status: linking urcu/arch/x86.h to urcu/arch.h > config.status: linking urcu/uatomic/x86.h to urcu/uatomic.h > config.status: executing depfiles commands > config.status: executing libtool commands > SMP support enabled. > Thread Local Storage (TLS): __thread. > > userspace-rcu # make > make all-recursive > make[1]: Entering directory `/usr/src/LTTng/userspace-rcu' > Making all in . > make[2]: Entering directory `/usr/src/LTTng/userspace-rcu' > make[2]: Leaving directory `/usr/src/LTTng/userspace-rcu' > Making all in doc > make[2]: Entering directory `/usr/src/LTTng/userspace-rcu/doc' > make[2]: Nothing to be done for `all'. > make[2]: Leaving directory `/usr/src/LTTng/userspace-rcu/doc' > Making all in tests > make[2]: Entering directory `/usr/src/LTTng/userspace-rcu/tests' > make[2]: Nothing to be done for `all'. > make[2]: Leaving directory `/usr/src/LTTng/userspace-rcu/tests' > make[1]: Leaving directory `/usr/src/LTTng/userspace-rcu' > > userspace-rcu # make install > Making install in . > make[1]: Entering directory `/usr/src/LTTng/userspace-rcu' > make[2]: Entering directory `/usr/src/LTTng/userspace-rcu' > test -z "/usr/local/lib" || /bin/mkdir -p "/usr/local/lib" > /bin/sh ./libtool --mode=install /usr/bin/install -c liburcu-common.la > liburcu.la liburcu-qsbr.la liburcu-mb.la liburcu-signal.la liburcu-bp.la > liburcu-cds.la '/usr/local/lib' > libtool: install: /usr/bin/install -c .libs/liburcu-common.so.2.0.0 > /usr/local/lib/liburcu-common.so.2.0.0 > libtool: install: (cd /usr/local/lib && { ln -s -f liburcu-common.so.2.0.0 > liburcu-common.so.2 || { rm -f liburcu-common.so.2 && ln -s > liburcu-common.so.2.0.0 liburcu-common.so.2; }; }) > libtool: install: (cd /usr/local/lib && { ln -s -f liburcu-common.so.2.0.0 > liburcu-common.so || { rm -f liburcu-common.so && ln -s > liburcu-common.so.2.0.0 liburcu-common.so; }; }) > libtool: install: /usr/bin/install -c .libs/liburcu-common.lai > /usr/local/lib/liburcu-common.la > libtool: install: warning: relinking `liburcu.la' > libtool: install: (cd /usr/src/LTTng/userspace-rcu; /bin/sh > /usr/src/LTTng/userspace-rcu/libtool --silent --tag CC --mode=relink gcc > -Wall -g -O2 -lpthread -version-info 2:0:0 -o liburcu.la -rpath > /usr/local/lib urcu.lo urcu-pointer.lo liburcu-common.la ) > libtool: install: /usr/bin/install -c .libs/liburcu.so.2.0.0T > /usr/local/lib/liburcu.so.2.0.0 > libtool: install: (cd /usr/local/lib && { ln -s -f liburcu.so.2.0.0 > liburcu.so.2 || { rm -f liburcu.so.2 && ln -s liburcu.so.2.0.0 > liburcu.so.2; }; }) > libtool: install: (cd /usr/local/lib && { ln -s -f liburcu.so.2.0.0 > liburcu.so || { rm -f liburcu.so && ln -s liburcu.so.2.0.0 liburcu.so; }; }) > libtool: install: /usr/bin/install -c .libs/liburcu.lai /usr/local/lib/ > liburcu.la > libtool: install: warning: relinking `liburcu-qsbr.la' > libtool: install: (cd /usr/src/LTTng/userspace-rcu; /bin/sh > /usr/src/LTTng/userspace-rcu/libtool --silent --tag CC --mode=relink gcc > -Wall -g -O2 -lpthread -version-info 2:0:0 -o liburcu-qsbr.la -rpath > /usr/local/lib urcu-qsbr.lo urcu-pointer.lo liburcu-common.la ) > libtool: install: /usr/bin/install -c .libs/liburcu-qsbr.so.2.0.0T > /usr/local/lib/liburcu-qsbr.so.2.0.0 > libtool: install: (cd /usr/local/lib && { ln -s -f liburcu-qsbr.so.2.0.0 > liburcu-qsbr.so.2 || { rm -f liburcu-qsbr.so.2 && ln -s > liburcu-qsbr.so.2.0.0 liburcu-qsbr.so.2; }; }) > libtool: install: (cd /usr/local/lib && { ln -s -f liburcu-qsbr.so.2.0.0 > liburcu-qsbr.so || { rm -f liburcu-qsbr.so && ln -s liburcu-qsbr.so.2.0.0 > liburcu-qsbr.so; }; }) > libtool: install: /usr/bin/install -c .libs/liburcu-qsbr.lai /usr/local/lib/ > liburcu-qsbr.la > libtool: install: warning: relinking `liburcu-mb.la' > libtool: install: (cd /usr/src/LTTng/userspace-rcu; /bin/sh > /usr/src/LTTng/userspace-rcu/libtool --silent --tag CC --mode=relink gcc > -DRCU_MB -g -O2 -lpthread -version-info 2:0:0 -o liburcu-mb.la -rpath > /usr/local/lib liburcu_mb_la-urcu.lo liburcu_mb_la-urcu-pointer.lo > liburcu-common.la ) > libtool: install: /usr/bin/install -c .libs/liburcu-mb.so.2.0.0T > /usr/local/lib/liburcu-mb.so.2.0.0 > libtool: install: (cd /usr/local/lib && { ln -s -f liburcu-mb.so.2.0.0 > liburcu-mb.so.2 || { rm -f liburcu-mb.so.2 && ln -s liburcu-mb.so.2.0.0 > liburcu-mb.so.2; }; }) > libtool: install: (cd /usr/local/lib && { ln -s -f liburcu-mb.so.2.0.0 > liburcu-mb.so || { rm -f liburcu-mb.so && ln -s liburcu-mb.so.2.0.0 > liburcu-mb.so; }; }) > libtool: install: /usr/bin/install -c .libs/liburcu-mb.lai /usr/local/lib/ > liburcu-mb.la > libtool: install: warning: relinking `liburcu-signal.la' > libtool: install: (cd /usr/src/LTTng/userspace-rcu; /bin/sh > /usr/src/LTTng/userspace-rcu/libtool --silent --tag CC --mode=relink gcc > -DRCU_SIGNAL -g -O2 -lpthread -version-info 2:0:0 -o > liburcu-signal.la-rpath /usr/local/lib liburcu_signal_la-urcu.lo > liburcu_signal_la-urcu-pointer.lo liburcu-common.la ) > libtool: install: /usr/bin/install -c .libs/liburcu-signal.so.2.0.0T > /usr/local/lib/liburcu-signal.so.2.0.0 > libtool: install: (cd /usr/local/lib && { ln -s -f liburcu-signal.so.2.0.0 > liburcu-signal.so.2 || { rm -f liburcu-signal.so.2 && ln -s > liburcu-signal.so.2.0.0 liburcu-signal.so.2; }; }) > libtool: install: (cd /usr/local/lib && { ln -s -f liburcu-signal.so.2.0.0 > liburcu-signal.so || { rm -f liburcu-signal.so && ln -s > liburcu-signal.so.2.0.0 liburcu-signal.so; }; }) > libtool: install: /usr/bin/install -c .libs/liburcu-signal.lai > /usr/local/lib/liburcu-signal.la > libtool: install: warning: relinking `liburcu-bp.la' > libtool: install: (cd /usr/src/LTTng/userspace-rcu; /bin/sh > /usr/src/LTTng/userspace-rcu/libtool --silent --tag CC --mode=relink gcc > -Wall -g -O2 -lpthread -version-info 2:0:0 -o liburcu-bp.la -rpath > /usr/local/lib urcu-bp.lo urcu-pointer.lo liburcu-common.la ) > libtool: install: /usr/bin/install -c .libs/liburcu-bp.so.2.0.0T > /usr/local/lib/liburcu-bp.so.2.0.0 > libtool: install: (cd /usr/local/lib && { ln -s -f liburcu-bp.so.2.0.0 > liburcu-bp.so.2 || { rm -f liburcu-bp.so.2 && ln -s liburcu-bp.so.2.0.0 > liburcu-bp.so.2; }; }) > libtool: install: (cd /usr/local/lib && { ln -s -f liburcu-bp.so.2.0.0 > liburcu-bp.so || { rm -f liburcu-bp.so && ln -s liburcu-bp.so.2.0.0 > liburcu-bp.so; }; }) > libtool: install: /usr/bin/install -c .libs/liburcu-bp.lai /usr/local/lib/ > liburcu-bp.la > libtool: install: warning: relinking `liburcu-cds.la' > libtool: install: (cd /usr/src/LTTng/userspace-rcu; /bin/sh > /usr/src/LTTng/userspace-rcu/libtool --silent --tag CC --mode=relink gcc > -Wall -g -O2 -lpthread -version-info 2:0:0 -o liburcu-cds.la -rpath > /usr/local/lib rculfqueue.lo rculfstack.lo lfstack.lo rculfhash.lo > rculfhash-mm-order.lo rculfhash-mm-chunk.lo rculfhash-mm-mmap.lo > liburcu-common.la ) > libtool: install: /usr/bin/install -c .libs/liburcu-cds.so.2.0.0T > /usr/local/lib/liburcu-cds.so.2.0.0 > libtool: install: (cd /usr/local/lib && { ln -s -f liburcu-cds.so.2.0.0 > liburcu-cds.so.2 || { rm -f liburcu-cds.so.2 && ln -s liburcu-cds.so.2.0.0 > liburcu-cds.so.2; }; }) > libtool: install: (cd /usr/local/lib && { ln -s -f liburcu-cds.so.2.0.0 > liburcu-cds.so || { rm -f liburcu-cds.so && ln -s liburcu-cds.so.2.0.0 > liburcu-cds.so; }; }) > libtool: install: /usr/bin/install -c .libs/liburcu-cds.lai /usr/local/lib/ > liburcu-cds.la > libtool: install: /usr/bin/install -c .libs/liburcu-common.a > /usr/local/lib/liburcu-common.a > libtool: install: chmod 644 /usr/local/lib/liburcu-common.a > libtool: install: ranlib /usr/local/lib/liburcu-common.a > libtool: install: /usr/bin/install -c .libs/liburcu.a > /usr/local/lib/liburcu.a > libtool: install: chmod 644 /usr/local/lib/liburcu.a > libtool: install: ranlib /usr/local/lib/liburcu.a > libtool: install: /usr/bin/install -c .libs/liburcu-qsbr.a > /usr/local/lib/liburcu-qsbr.a > libtool: install: chmod 644 /usr/local/lib/liburcu-qsbr.a > libtool: install: ranlib /usr/local/lib/liburcu-qsbr.a > libtool: install: /usr/bin/install -c .libs/liburcu-mb.a > /usr/local/lib/liburcu-mb.a > libtool: install: chmod 644 /usr/local/lib/liburcu-mb.a > libtool: install: ranlib /usr/local/lib/liburcu-mb.a > libtool: install: /usr/bin/install -c .libs/liburcu-signal.a > /usr/local/lib/liburcu-signal.a > libtool: install: chmod 644 /usr/local/lib/liburcu-signal.a > libtool: install: ranlib /usr/local/lib/liburcu-signal.a > libtool: install: /usr/bin/install -c .libs/liburcu-bp.a > /usr/local/lib/liburcu-bp.a > libtool: install: chmod 644 /usr/local/lib/liburcu-bp.a > libtool: install: ranlib /usr/local/lib/liburcu-bp.a > libtool: install: /usr/bin/install -c .libs/liburcu-cds.a > /usr/local/lib/liburcu-cds.a > libtool: install: chmod 644 /usr/local/lib/liburcu-cds.a > libtool: install: ranlib /usr/local/lib/liburcu-cds.a > libtool: finish: > PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.4.4:/usr/i686-pc-linux-gnu/gnat-gcc-bin/4.3:/usr/libexec/gnat-gcc/i686-pc-linux-gnu/4.3:/usr/lib/subversion/bin:/opt/gnat-gpl/bin:/sbin" > ldconfig -n /usr/local/lib > > ---------------------------------------------------------------------- > Libraries have been installed in: > /usr/local/lib > > If you ever happen to want to link against installed libraries > in a given directory, LIBDIR, you must either use libtool, and > specify the full pathname of the library, or use the `-LLIBDIR' > flag during linking and do at least one of the following: > - add LIBDIR to the `LD_LIBRARY_PATH' environment variable > during execution > - add LIBDIR to the `LD_RUN_PATH' environment variable > during linking > - use the `-Wl,-rpath -Wl,LIBDIR' linker flag > - have your system administrator add LIBDIR to `/etc/ld.so.conf' > > See any operating system documentation about shared libraries for > more information, such as the ld(1) and ld.so(8) manual pages. > ---------------------------------------------------------------------- > test -z "/usr/local/share/doc/userspace-rcu" || /bin/mkdir -p > "/usr/local/share/doc/userspace-rcu" > /usr/bin/install -c -m 644 README ChangeLog > '/usr/local/share/doc/userspace-rcu' > test -z "/usr/local/include" || /bin/mkdir -p "/usr/local/include" > /usr/bin/install -c -m 644 urcu.h urcu-bp.h urcu-call-rcu.h urcu-defer.h > urcu-pointer.h urcu-qsbr.h urcu-flavor.h '/usr/local/include' > test -z "/usr/local/include" || /bin/mkdir -p "/usr/local/include" > /bin/mkdir -p '/usr/local/include/urcu/static' > /usr/bin/install -c -m 644 ./urcu/static/lfstack.h > ./urcu/static/rculfqueue.h ./urcu/static/rculfstack.h > ./urcu/static/urcu-bp.h ./urcu/static/urcu-pointer.h > ./urcu/static/urcu-qsbr.h ./urcu/static/urcu.h ./urcu/static/wfcqueue.h > ./urcu/static/wfqueue.h ./urcu/static/wfstack.h > '/usr/local/include/urcu/static' > /bin/mkdir -p '/usr/local/include/urcu/map' > /usr/bin/install -c -m 644 ./urcu/map/urcu-bp.h ./urcu/map/urcu-qsbr.h > ./urcu/map/urcu.h '/usr/local/include/urcu/map' > /bin/mkdir -p '/usr/local/include/urcu/arch' > /usr/bin/install -c -m 644 urcu/arch/generic.h > '/usr/local/include/urcu/arch' > /bin/mkdir -p '/usr/local/include/urcu/uatomic' > /usr/bin/install -c -m 644 urcu/uatomic/generic.h > '/usr/local/include/urcu/uatomic' > /bin/mkdir -p '/usr/local/include/urcu' > /usr/bin/install -c -m 644 urcu/compiler.h urcu/hlist.h urcu/list.h > urcu/rculist.h urcu/rcuhlist.h urcu/system.h urcu/futex.h urcu/wfstack.h > urcu/wfqueue.h urcu/rculfstack.h urcu/rculfqueue.h urcu/ref.h urcu/cds.h > urcu/urcu_ref.h urcu/urcu-futex.h urcu/uatomic_arch.h urcu/rculfhash.h > urcu/wfcqueue.h urcu/lfstack.h urcu/tls-compat.h '/usr/local/include/urcu' > test -z "/usr/local/include" || /bin/mkdir -p "/usr/local/include" > /bin/mkdir -p '/usr/local/include/urcu' > /usr/bin/install -c -m 644 urcu/arch.h urcu/uatomic.h urcu/config.h > '/usr/local/include/urcu' > test -z "/usr/local/lib/pkgconfig" || /bin/mkdir -p > "/usr/local/lib/pkgconfig" > /usr/bin/install -c -m 644 liburcu-cds.pc liburcu.pc liburcu-bp.pc > liburcu-qsbr.pc liburcu-signal.pc liburcu-mb.pc '/usr/local/lib/pkgconfig' > make[2]: Leaving directory `/usr/src/LTTng/userspace-rcu' > make[1]: Leaving directory `/usr/src/LTTng/userspace-rcu' > Making install in doc > make[1]: Entering directory `/usr/src/LTTng/userspace-rcu/doc' > make[2]: Entering directory `/usr/src/LTTng/userspace-rcu/doc' > make[2]: Nothing to be done for `install-exec-am'. > test -z "/usr/local/share/doc/userspace-rcu" || /bin/mkdir -p > "/usr/local/share/doc/userspace-rcu" > /usr/bin/install -c -m 644 rcu-api.txt cds-api.txt uatomic-api.txt > '/usr/local/share/doc/userspace-rcu' > make[2]: Leaving directory `/usr/src/LTTng/userspace-rcu/doc' > make[1]: Leaving directory `/usr/src/LTTng/userspace-rcu/doc' > Making install in tests > make[1]: Entering directory `/usr/src/LTTng/userspace-rcu/tests' > make[2]: Entering directory `/usr/src/LTTng/userspace-rcu/tests' > make[2]: Nothing to be done for `install-exec-am'. > make[2]: Nothing to be done for `install-data-am'. > make[2]: Leaving directory `/usr/src/LTTng/userspace-rcu/tests' > make[1]: Leaving directory `/usr/src/LTTng/userspace-rcu/tests' > > userspace-rcu # ldconfig > > STEP3: > #git clone http://git.lttng.org/lttng-ust.git > #cd lttng-ust > lttng-ust # git checkout master > Already on 'master' > > lttng-ust # ./bootstrap > + '[' '!' -e config ']' > + autoreconf -i > > lttng-ust # ./configure > checking build system type... i686-pc-linux-gnu > checking host system type... i686-pc-linux-gnu > checking target system type... i686-pc-linux-gnu > checking for a BSD-compatible install... /usr/bin/install -c > checking whether build environment is sane... yes > checking for a thread-safe mkdir -p... /bin/mkdir -p > checking for gawk... gawk > checking whether make sets $(MAKE)... yes > checking for a sed that does not truncate output... /bin/sed > checking for grep that handles long lines and -e... /bin/grep > checking for occurence(s) of link_all_deplibs = no in > ./config/libtool.m4... none > checking for gcc... gcc > checking whether the C compiler works... yes > checking for C compiler default output file name... a.out > .checking for suffix of executables... > checking whether we are cross compiling... no > checking for suffix of object files... o > checking whether we are using the GNU C compiler... yes > checking whether gcc accepts -g... yes > checking for gcc option to accept ISO C89... none needed > checking for style of include used by make... GNU > checking dependency style of gcc... gcc3 > checking for g++... g++ > checking whether we are using the GNU C++ compiler... yes > checking whether g++ accepts -g... yes > checking dependency style of g++... gcc3 > checking whether make sets $(MAKE)... (cached) yes > checking how to print strings... printf > checking for a sed that does not truncate output... (cached) /bin/sed > checking for egrep... /bin/grep -E > checking for fgrep... /bin/grep -F > checking for ld used by gcc... /usr/i686-pc-linux-gnu/bin/ld > checking if the linker (/usr/i686-pc-linux-gnu/bin/ld) is GNU ld... yes > checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B > checking the name lister (/usr/bin/nm -B) interface... BSD nm > checking whether ln -s works... yes > checking the maximum length of command line arguments... 1572864 > checking whether the shell understands some XSI constructs... yes > checking whether the shell understands "+="... yes > checking for /usr/i686-pc-linux-gnu/bin/ld option to reload object files... > -r > checking for objdump... objdump > checking how to recognize dependent libraries... pass_all > checking for ar... ar > checking for strip... strip > checking for ranlib... ranlib > checking command to parse /usr/bin/nm -B output from gcc object... ok > checking how to run the C preprocessor... gcc -E > checking for ANSI C header files... yes > checking for sys/types.h... yes > checking for sys/stat.h... yes > checking for stdlib.h... yes > checking for string.h... yes > checking for memory.h... yes > checking for strings.h... yes > checking for inttypes.h... yes > checking for stdint.h... yes > checking for unistd.h... yes > checking for dlfcn.h... yes > checking for objdir... .libs > checking if gcc supports -fno-rtti -fno-exceptions... no > checking for gcc option to produce PIC... -fPIC -DPIC > checking if gcc PIC flag -fPIC -DPIC works... yes > checking if gcc static flag -static works... yes > checking if gcc supports -c -o file.o... yes > checking if gcc supports -c -o file.o... (cached) yes > checking whether the gcc linker (/usr/i686-pc-linux-gnu/bin/ld) supports > shared libraries... yes > checking whether -lc should be explicitly linked in... no > checking dynamic linker characteristics... GNU/Linux ld.so > checking how to hardcode library paths into programs... immediate > checking whether stripping libraries is possible... yes > checking if libtool supports shared libraries... yes > checking whether to build shared libraries... yes > checking whether to build static libraries... yes > checking how to run the C++ preprocessor... g++ -E > checking for ld used by g++... /usr/i686-pc-linux-gnu/bin/ld > checking if the linker (/usr/i686-pc-linux-gnu/bin/ld) is GNU ld... yes > checking whether the g++ linker (/usr/i686-pc-linux-gnu/bin/ld) supports > shared libraries... yes > checking for g++ option to produce PIC... -fPIC -DPIC > checking if g++ PIC flag -fPIC -DPIC works... yes > checking if g++ static flag -static works... yes > checking if g++ supports -c -o file.o... yes > checking if g++ supports -c -o file.o... (cached) yes > checking whether the g++ linker (/usr/i686-pc-linux-gnu/bin/ld) supports > shared libraries... yes > checking dynamic linker characteristics... (cached) GNU/Linux ld.so > checking how to hardcode library paths into programs... immediate > checking whether the C++ compiler works... yes > checking for dlopen in -ldl... yes > checking for pthread_create in -lpthread... yes > checking for uuid_generate in -luuid... yes > checking for inline... inline > checking for stdlib.h... (cached) yes > checking for GNU libc compatible malloc... yes > checking for gettimeofday... yes checking for munmap... yes > checking for socket... yes > checking for strerror... yes > checking for strtol... yes > checking for sched_getcpu... yes > checking for sysconf... yes > checking urcu-bp.h usability... yes > checking urcu-bp.h presence... yes > checking for urcu-bp.h... yes > checking for _cds_lfht_new in -lurcu-cds... yes > checking caa_likely()... yes > checking for synchronize_rcu_bp in -lurcu-bp... no > configure: error: Cannot find liburcu-bp lib. Use LDFLAGS=-Ldir to specify > its location. > > Why this error? > Is LTTng-ust not stabile? > Kind regards. > Vanni Genua -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From jeremie.galarneau at efficios.com Mon Feb 18 10:10:22 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Mon, 18 Feb 2013 10:10:22 -0500 Subject: [lttng-dev] liburcu-bp not found In-Reply-To: <20130218140302.GA2606@Krystal> References: <20130218140302.GA2606@Krystal> Message-ID: Perhaps libs should be installed in /usr/lib on Gentoo? In that case, run configure with the appropriate --prefix switch when configuring userspace-rcu. ./configure --prefix=/usr On Mon, Feb 18, 2013 at 9:03 AM, Mathieu Desnoyers wrote: > * Vanni Genua (vannigenua at gmail.com) wrote: >> Hi Mathieu, >> After a long time, I decided to install LTTng on Intel Atom Z530 too. >> My kernel: 3.6.2-rt4 >> My instruction set:x86 >> My Linux distro:gentoo. >> After having installed glibc, uuidtools, automake, autoconf, libtools, I >> tried to install LTTng this way, getting some errors as reported below: >> > > CCing lttng-dev. Please contact lttng-dev at lists.lttng.org with these > issues, so that other LTTng developers can help you out. > > Thanks, > > Mathieu > >> STEP1: >> #git clone http://git.lttng.org/lttng-modules.git >> >> #cd lttng-modules >> >> lttng-modules # make >> make -C /lib/modules/3.6.2-rt4/build M=/usr/src/LTTng/lttng-modules modules >> make[1]: Entering directory `/usr/src/linux-3.6.2-rt4' >> Building modules, stage 2. >> MODPOST 0 modules >> make[1]: Leaving directory `/usr/src/linux-3.6.2-rt4' >> >> lttng-modules # make modules_install >> make -C /lib/modules/3.6.2-rt4/build M=/usr/src/LTTng/lttng-modules >> modules_install >> make[1]: Entering directory `/usr/src/linux-3.6.2-rt4' >> DEPMOD 3.6.2-rt4 >> make[1]: Leaving directory `/usr/src/linux-3.6.2-rt4' >> >> lttng-modules # depmod -a >> >> STEP2: >> # git clone http://git.lttng.org/userspace-rcu.git >> >> #cd userspace-rcu >> userspace-rcu # ./bootstrap >> userspace-rcu # ./configure >> checking build system type... i686-pc-linux-gnu >> checking host system type... i686-pc-linux-gnu >> checking target system type... i686-pc-linux-gnu >> checking for a BSD-compatible install... /usr/bin/install -c >> checking whether build environment is sane... yes >> checking for a thread-safe mkdir -p... /bin/mkdir -p >> checking for gawk... gawk >> checking whether make sets $(MAKE)... yes >> checking for style of include used by make... GNU >> checking for gcc... gcc >> checking whether the C compiler works... yes >> checking for C compiler default output file name... a.out >> checking for suffix of executables... >> checking whether we are cross compiling... no >> checking for suffix of object files... o >> checking whether we are using the GNU C compiler... yes >> checking whether gcc accepts -g... yes >> checking for gcc option to accept ISO C89... none needed >> checking dependency style of gcc... gcc3 >> checking for thread local storage (TLS) class... __thread >> checking for gcc... (cached) gcc >> checking whether we are using the GNU C compiler... (cached) yes >> checking whether gcc accepts -g... (cached) yes >> checking for gcc option to accept ISO C89... (cached) none needed >> checking dependency style of gcc... (cached) gcc3 >> checking whether make sets $(MAKE)... (cached) yes >> checking how to print strings... printf >> checking for a sed that does not truncate output... /bin/sed >> checking for grep that handles long lines and -e... /bin/grep >> checking for egrep... /bin/grep -E >> checking for fgrep... /bin/grep -F >> checking for ld used by gcc... /usr/i686-pc-linux-gnu/bin/ld >> checking if the linker (/usr/i686-pc-linux-gnu/bin/ld) is GNU ld... yes >> checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B >> checking the name lister (/usr/bin/nm -B) interface... BSD nm >> checking whether ln -s works... yes >> checking the maximum length of command line arguments... 1572864 >> checking whether the shell understands some XSI constructs... yes >> checking whether the shell understands "+="... yes >> checking for /usr/i686-pc-linux-gnu/bin/ld option to reload object files... >> -r >> checking for objdump... objdump checking how to recognize dependent >> libraries... pass_all >> checking for ar... ar >> checking for strip... strip >> checking for ranlib... ranlib >> checking command to parse /usr/bin/nm -B output from gcc object... ok >> checking how to run the C preprocessor... gcc -E >> checking for ANSI C header files... yes >> checking for sys/types.h... yes >> checking for sys/stat.h... yes >> checking for stdlib.h... yes >> checking for string.h... yes >> checking for memory.h... yes >> checking for strings.h... yes >> checking for inttypes.h... yes >> checking for stdint.h... yes >> checking for unistd.h... yes >> checking for dlfcn.h... yes >> checking for objdir... .libs >> checking if gcc supports -fno-rtti -fno-exceptions... no >> checking for gcc option to produce PIC... -fPIC -DPIC >> checking if gcc PIC flag -fPIC -DPIC works... yes >> checking if gcc static flag -static works... yes >> checking if gcc supports -c -o file.o... yes >> checking if gcc supports -c -o file.o... (cached) yes >> checking whether the gcc linker (/usr/i686-pc-linux-gnu/bin/ld) supports >> shared libraries... yes >> checking whether -lc should be explicitly linked in... no >> checking dynamic linker characteristics... GNU/Linux ld.so >> checking how to hardcode library paths into programs... immediate >> checking whether stripping libraries is possible... yes >> checking if libtool supports shared libraries... yes >> checking whether to build shared libraries... yes >> checking whether to build static libraries... yes >> checking for inline... inline >> checking for pid_t... yes >> checking for size_t... yes >> checking for stdlib.h... (cached) yes >> checking for GNU libc compatible malloc... yes >> checking for stdlib.h... (cached) yes >> checking for unistd.h... (cached) yes >> checking for sys/param.h... yes >> checking for getpagesize... yes >> checking for working mmap... yes >> checking for bzero... yes >> checking for gettimeofday... yes >> checking for munmap... yes >> checking for sched_getcpu... yes >> checking for strtoul... yes >> checking for sysconf... yes >> checking if architecture really supports the mfence instruction... no >> checking for sys_futex()... yes >> checking for sched_setaffinity... yes >> checking for cpu_set_t... yes >> checking whether CPU_ZERO works... yes >> checking how many arguments sched_setaffinity takes... 3 >> configure: creating ./config.status >> config.status: creating Makefile >> config.status: creating doc/Makefile >> config.status: creating tests/Makefile >> config.status: creating liburcu.pc >> config.status: creating liburcu-bp.pc >> config.status: creating liburcu-cds.pc >> config.status: creating liburcu-qsbr.pc >> config.status: creating liburcu-mb.pc >> config.status: creating liburcu-signal.pc >> config.status: creating config.h >> config.status: config.h is unchanged >> config.status: creating urcu/config.h >> config.status: urcu/config.h is unchanged >> config.status: linking urcu/arch/x86.h to urcu/arch.h >> config.status: linking urcu/uatomic/x86.h to urcu/uatomic.h >> config.status: executing depfiles commands >> config.status: executing libtool commands >> SMP support enabled. >> Thread Local Storage (TLS): __thread. >> >> userspace-rcu # make >> make all-recursive >> make[1]: Entering directory `/usr/src/LTTng/userspace-rcu' >> Making all in . >> make[2]: Entering directory `/usr/src/LTTng/userspace-rcu' >> make[2]: Leaving directory `/usr/src/LTTng/userspace-rcu' >> Making all in doc >> make[2]: Entering directory `/usr/src/LTTng/userspace-rcu/doc' >> make[2]: Nothing to be done for `all'. >> make[2]: Leaving directory `/usr/src/LTTng/userspace-rcu/doc' >> Making all in tests >> make[2]: Entering directory `/usr/src/LTTng/userspace-rcu/tests' >> make[2]: Nothing to be done for `all'. >> make[2]: Leaving directory `/usr/src/LTTng/userspace-rcu/tests' >> make[1]: Leaving directory `/usr/src/LTTng/userspace-rcu' >> >> userspace-rcu # make install >> Making install in . >> make[1]: Entering directory `/usr/src/LTTng/userspace-rcu' >> make[2]: Entering directory `/usr/src/LTTng/userspace-rcu' >> test -z "/usr/local/lib" || /bin/mkdir -p "/usr/local/lib" >> /bin/sh ./libtool --mode=install /usr/bin/install -c liburcu-common.la >> liburcu.la liburcu-qsbr.la liburcu-mb.la liburcu-signal.la liburcu-bp.la >> liburcu-cds.la '/usr/local/lib' >> libtool: install: /usr/bin/install -c .libs/liburcu-common.so.2.0.0 >> /usr/local/lib/liburcu-common.so.2.0.0 >> libtool: install: (cd /usr/local/lib && { ln -s -f liburcu-common.so.2.0.0 >> liburcu-common.so.2 || { rm -f liburcu-common.so.2 && ln -s >> liburcu-common.so.2.0.0 liburcu-common.so.2; }; }) >> libtool: install: (cd /usr/local/lib && { ln -s -f liburcu-common.so.2.0.0 >> liburcu-common.so || { rm -f liburcu-common.so && ln -s >> liburcu-common.so.2.0.0 liburcu-common.so; }; }) >> libtool: install: /usr/bin/install -c .libs/liburcu-common.lai >> /usr/local/lib/liburcu-common.la >> libtool: install: warning: relinking `liburcu.la' >> libtool: install: (cd /usr/src/LTTng/userspace-rcu; /bin/sh >> /usr/src/LTTng/userspace-rcu/libtool --silent --tag CC --mode=relink gcc >> -Wall -g -O2 -lpthread -version-info 2:0:0 -o liburcu.la -rpath >> /usr/local/lib urcu.lo urcu-pointer.lo liburcu-common.la ) >> libtool: install: /usr/bin/install -c .libs/liburcu.so.2.0.0T >> /usr/local/lib/liburcu.so.2.0.0 >> libtool: install: (cd /usr/local/lib && { ln -s -f liburcu.so.2.0.0 >> liburcu.so.2 || { rm -f liburcu.so.2 && ln -s liburcu.so.2.0.0 >> liburcu.so.2; }; }) >> libtool: install: (cd /usr/local/lib && { ln -s -f liburcu.so.2.0.0 >> liburcu.so || { rm -f liburcu.so && ln -s liburcu.so.2.0.0 liburcu.so; }; }) >> libtool: install: /usr/bin/install -c .libs/liburcu.lai /usr/local/lib/ >> liburcu.la >> libtool: install: warning: relinking `liburcu-qsbr.la' >> libtool: install: (cd /usr/src/LTTng/userspace-rcu; /bin/sh >> /usr/src/LTTng/userspace-rcu/libtool --silent --tag CC --mode=relink gcc >> -Wall -g -O2 -lpthread -version-info 2:0:0 -o liburcu-qsbr.la -rpath >> /usr/local/lib urcu-qsbr.lo urcu-pointer.lo liburcu-common.la ) >> libtool: install: /usr/bin/install -c .libs/liburcu-qsbr.so.2.0.0T >> /usr/local/lib/liburcu-qsbr.so.2.0.0 >> libtool: install: (cd /usr/local/lib && { ln -s -f liburcu-qsbr.so.2.0.0 >> liburcu-qsbr.so.2 || { rm -f liburcu-qsbr.so.2 && ln -s >> liburcu-qsbr.so.2.0.0 liburcu-qsbr.so.2; }; }) >> libtool: install: (cd /usr/local/lib && { ln -s -f liburcu-qsbr.so.2.0.0 >> liburcu-qsbr.so || { rm -f liburcu-qsbr.so && ln -s liburcu-qsbr.so.2.0.0 >> liburcu-qsbr.so; }; }) >> libtool: install: /usr/bin/install -c .libs/liburcu-qsbr.lai /usr/local/lib/ >> liburcu-qsbr.la >> libtool: install: warning: relinking `liburcu-mb.la' >> libtool: install: (cd /usr/src/LTTng/userspace-rcu; /bin/sh >> /usr/src/LTTng/userspace-rcu/libtool --silent --tag CC --mode=relink gcc >> -DRCU_MB -g -O2 -lpthread -version-info 2:0:0 -o liburcu-mb.la -rpath >> /usr/local/lib liburcu_mb_la-urcu.lo liburcu_mb_la-urcu-pointer.lo >> liburcu-common.la ) >> libtool: install: /usr/bin/install -c .libs/liburcu-mb.so.2.0.0T >> /usr/local/lib/liburcu-mb.so.2.0.0 >> libtool: install: (cd /usr/local/lib && { ln -s -f liburcu-mb.so.2.0.0 >> liburcu-mb.so.2 || { rm -f liburcu-mb.so.2 && ln -s liburcu-mb.so.2.0.0 >> liburcu-mb.so.2; }; }) >> libtool: install: (cd /usr/local/lib && { ln -s -f liburcu-mb.so.2.0.0 >> liburcu-mb.so || { rm -f liburcu-mb.so && ln -s liburcu-mb.so.2.0.0 >> liburcu-mb.so; }; }) >> libtool: install: /usr/bin/install -c .libs/liburcu-mb.lai /usr/local/lib/ >> liburcu-mb.la >> libtool: install: warning: relinking `liburcu-signal.la' >> libtool: install: (cd /usr/src/LTTng/userspace-rcu; /bin/sh >> /usr/src/LTTng/userspace-rcu/libtool --silent --tag CC --mode=relink gcc >> -DRCU_SIGNAL -g -O2 -lpthread -version-info 2:0:0 -o >> liburcu-signal.la-rpath /usr/local/lib liburcu_signal_la-urcu.lo >> liburcu_signal_la-urcu-pointer.lo liburcu-common.la ) >> libtool: install: /usr/bin/install -c .libs/liburcu-signal.so.2.0.0T >> /usr/local/lib/liburcu-signal.so.2.0.0 >> libtool: install: (cd /usr/local/lib && { ln -s -f liburcu-signal.so.2.0.0 >> liburcu-signal.so.2 || { rm -f liburcu-signal.so.2 && ln -s >> liburcu-signal.so.2.0.0 liburcu-signal.so.2; }; }) >> libtool: install: (cd /usr/local/lib && { ln -s -f liburcu-signal.so.2.0.0 >> liburcu-signal.so || { rm -f liburcu-signal.so && ln -s >> liburcu-signal.so.2.0.0 liburcu-signal.so; }; }) >> libtool: install: /usr/bin/install -c .libs/liburcu-signal.lai >> /usr/local/lib/liburcu-signal.la >> libtool: install: warning: relinking `liburcu-bp.la' >> libtool: install: (cd /usr/src/LTTng/userspace-rcu; /bin/sh >> /usr/src/LTTng/userspace-rcu/libtool --silent --tag CC --mode=relink gcc >> -Wall -g -O2 -lpthread -version-info 2:0:0 -o liburcu-bp.la -rpath >> /usr/local/lib urcu-bp.lo urcu-pointer.lo liburcu-common.la ) >> libtool: install: /usr/bin/install -c .libs/liburcu-bp.so.2.0.0T >> /usr/local/lib/liburcu-bp.so.2.0.0 >> libtool: install: (cd /usr/local/lib && { ln -s -f liburcu-bp.so.2.0.0 >> liburcu-bp.so.2 || { rm -f liburcu-bp.so.2 && ln -s liburcu-bp.so.2.0.0 >> liburcu-bp.so.2; }; }) >> libtool: install: (cd /usr/local/lib && { ln -s -f liburcu-bp.so.2.0.0 >> liburcu-bp.so || { rm -f liburcu-bp.so && ln -s liburcu-bp.so.2.0.0 >> liburcu-bp.so; }; }) >> libtool: install: /usr/bin/install -c .libs/liburcu-bp.lai /usr/local/lib/ >> liburcu-bp.la >> libtool: install: warning: relinking `liburcu-cds.la' >> libtool: install: (cd /usr/src/LTTng/userspace-rcu; /bin/sh >> /usr/src/LTTng/userspace-rcu/libtool --silent --tag CC --mode=relink gcc >> -Wall -g -O2 -lpthread -version-info 2:0:0 -o liburcu-cds.la -rpath >> /usr/local/lib rculfqueue.lo rculfstack.lo lfstack.lo rculfhash.lo >> rculfhash-mm-order.lo rculfhash-mm-chunk.lo rculfhash-mm-mmap.lo >> liburcu-common.la ) >> libtool: install: /usr/bin/install -c .libs/liburcu-cds.so.2.0.0T >> /usr/local/lib/liburcu-cds.so.2.0.0 >> libtool: install: (cd /usr/local/lib && { ln -s -f liburcu-cds.so.2.0.0 >> liburcu-cds.so.2 || { rm -f liburcu-cds.so.2 && ln -s liburcu-cds.so.2.0.0 >> liburcu-cds.so.2; }; }) >> libtool: install: (cd /usr/local/lib && { ln -s -f liburcu-cds.so.2.0.0 >> liburcu-cds.so || { rm -f liburcu-cds.so && ln -s liburcu-cds.so.2.0.0 >> liburcu-cds.so; }; }) >> libtool: install: /usr/bin/install -c .libs/liburcu-cds.lai /usr/local/lib/ >> liburcu-cds.la >> libtool: install: /usr/bin/install -c .libs/liburcu-common.a >> /usr/local/lib/liburcu-common.a >> libtool: install: chmod 644 /usr/local/lib/liburcu-common.a >> libtool: install: ranlib /usr/local/lib/liburcu-common.a >> libtool: install: /usr/bin/install -c .libs/liburcu.a >> /usr/local/lib/liburcu.a >> libtool: install: chmod 644 /usr/local/lib/liburcu.a >> libtool: install: ranlib /usr/local/lib/liburcu.a >> libtool: install: /usr/bin/install -c .libs/liburcu-qsbr.a >> /usr/local/lib/liburcu-qsbr.a >> libtool: install: chmod 644 /usr/local/lib/liburcu-qsbr.a >> libtool: install: ranlib /usr/local/lib/liburcu-qsbr.a >> libtool: install: /usr/bin/install -c .libs/liburcu-mb.a >> /usr/local/lib/liburcu-mb.a >> libtool: install: chmod 644 /usr/local/lib/liburcu-mb.a >> libtool: install: ranlib /usr/local/lib/liburcu-mb.a >> libtool: install: /usr/bin/install -c .libs/liburcu-signal.a >> /usr/local/lib/liburcu-signal.a >> libtool: install: chmod 644 /usr/local/lib/liburcu-signal.a >> libtool: install: ranlib /usr/local/lib/liburcu-signal.a >> libtool: install: /usr/bin/install -c .libs/liburcu-bp.a >> /usr/local/lib/liburcu-bp.a >> libtool: install: chmod 644 /usr/local/lib/liburcu-bp.a >> libtool: install: ranlib /usr/local/lib/liburcu-bp.a >> libtool: install: /usr/bin/install -c .libs/liburcu-cds.a >> /usr/local/lib/liburcu-cds.a >> libtool: install: chmod 644 /usr/local/lib/liburcu-cds.a >> libtool: install: ranlib /usr/local/lib/liburcu-cds.a >> libtool: finish: >> PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.4.4:/usr/i686-pc-linux-gnu/gnat-gcc-bin/4.3:/usr/libexec/gnat-gcc/i686-pc-linux-gnu/4.3:/usr/lib/subversion/bin:/opt/gnat-gpl/bin:/sbin" >> ldconfig -n /usr/local/lib >> >> ---------------------------------------------------------------------- >> Libraries have been installed in: >> /usr/local/lib >> >> If you ever happen to want to link against installed libraries >> in a given directory, LIBDIR, you must either use libtool, and >> specify the full pathname of the library, or use the `-LLIBDIR' >> flag during linking and do at least one of the following: >> - add LIBDIR to the `LD_LIBRARY_PATH' environment variable >> during execution >> - add LIBDIR to the `LD_RUN_PATH' environment variable >> during linking >> - use the `-Wl,-rpath -Wl,LIBDIR' linker flag >> - have your system administrator add LIBDIR to `/etc/ld.so.conf' >> >> See any operating system documentation about shared libraries for >> more information, such as the ld(1) and ld.so(8) manual pages. >> ---------------------------------------------------------------------- >> test -z "/usr/local/share/doc/userspace-rcu" || /bin/mkdir -p >> "/usr/local/share/doc/userspace-rcu" >> /usr/bin/install -c -m 644 README ChangeLog >> '/usr/local/share/doc/userspace-rcu' >> test -z "/usr/local/include" || /bin/mkdir -p "/usr/local/include" >> /usr/bin/install -c -m 644 urcu.h urcu-bp.h urcu-call-rcu.h urcu-defer.h >> urcu-pointer.h urcu-qsbr.h urcu-flavor.h '/usr/local/include' >> test -z "/usr/local/include" || /bin/mkdir -p "/usr/local/include" >> /bin/mkdir -p '/usr/local/include/urcu/static' >> /usr/bin/install -c -m 644 ./urcu/static/lfstack.h >> ./urcu/static/rculfqueue.h ./urcu/static/rculfstack.h >> ./urcu/static/urcu-bp.h ./urcu/static/urcu-pointer.h >> ./urcu/static/urcu-qsbr.h ./urcu/static/urcu.h ./urcu/static/wfcqueue.h >> ./urcu/static/wfqueue.h ./urcu/static/wfstack.h >> '/usr/local/include/urcu/static' >> /bin/mkdir -p '/usr/local/include/urcu/map' >> /usr/bin/install -c -m 644 ./urcu/map/urcu-bp.h ./urcu/map/urcu-qsbr.h >> ./urcu/map/urcu.h '/usr/local/include/urcu/map' >> /bin/mkdir -p '/usr/local/include/urcu/arch' >> /usr/bin/install -c -m 644 urcu/arch/generic.h >> '/usr/local/include/urcu/arch' >> /bin/mkdir -p '/usr/local/include/urcu/uatomic' >> /usr/bin/install -c -m 644 urcu/uatomic/generic.h >> '/usr/local/include/urcu/uatomic' >> /bin/mkdir -p '/usr/local/include/urcu' >> /usr/bin/install -c -m 644 urcu/compiler.h urcu/hlist.h urcu/list.h >> urcu/rculist.h urcu/rcuhlist.h urcu/system.h urcu/futex.h urcu/wfstack.h >> urcu/wfqueue.h urcu/rculfstack.h urcu/rculfqueue.h urcu/ref.h urcu/cds.h >> urcu/urcu_ref.h urcu/urcu-futex.h urcu/uatomic_arch.h urcu/rculfhash.h >> urcu/wfcqueue.h urcu/lfstack.h urcu/tls-compat.h '/usr/local/include/urcu' >> test -z "/usr/local/include" || /bin/mkdir -p "/usr/local/include" >> /bin/mkdir -p '/usr/local/include/urcu' >> /usr/bin/install -c -m 644 urcu/arch.h urcu/uatomic.h urcu/config.h >> '/usr/local/include/urcu' >> test -z "/usr/local/lib/pkgconfig" || /bin/mkdir -p >> "/usr/local/lib/pkgconfig" >> /usr/bin/install -c -m 644 liburcu-cds.pc liburcu.pc liburcu-bp.pc >> liburcu-qsbr.pc liburcu-signal.pc liburcu-mb.pc '/usr/local/lib/pkgconfig' >> make[2]: Leaving directory `/usr/src/LTTng/userspace-rcu' >> make[1]: Leaving directory `/usr/src/LTTng/userspace-rcu' >> Making install in doc >> make[1]: Entering directory `/usr/src/LTTng/userspace-rcu/doc' >> make[2]: Entering directory `/usr/src/LTTng/userspace-rcu/doc' >> make[2]: Nothing to be done for `install-exec-am'. >> test -z "/usr/local/share/doc/userspace-rcu" || /bin/mkdir -p >> "/usr/local/share/doc/userspace-rcu" >> /usr/bin/install -c -m 644 rcu-api.txt cds-api.txt uatomic-api.txt >> '/usr/local/share/doc/userspace-rcu' >> make[2]: Leaving directory `/usr/src/LTTng/userspace-rcu/doc' >> make[1]: Leaving directory `/usr/src/LTTng/userspace-rcu/doc' >> Making install in tests >> make[1]: Entering directory `/usr/src/LTTng/userspace-rcu/tests' >> make[2]: Entering directory `/usr/src/LTTng/userspace-rcu/tests' >> make[2]: Nothing to be done for `install-exec-am'. >> make[2]: Nothing to be done for `install-data-am'. >> make[2]: Leaving directory `/usr/src/LTTng/userspace-rcu/tests' >> make[1]: Leaving directory `/usr/src/LTTng/userspace-rcu/tests' >> >> userspace-rcu # ldconfig >> >> STEP3: >> #git clone http://git.lttng.org/lttng-ust.git >> #cd lttng-ust >> lttng-ust # git checkout master >> Already on 'master' >> >> lttng-ust # ./bootstrap >> + '[' '!' -e config ']' >> + autoreconf -i >> >> lttng-ust # ./configure >> checking build system type... i686-pc-linux-gnu >> checking host system type... i686-pc-linux-gnu >> checking target system type... i686-pc-linux-gnu >> checking for a BSD-compatible install... /usr/bin/install -c >> checking whether build environment is sane... yes >> checking for a thread-safe mkdir -p... /bin/mkdir -p >> checking for gawk... gawk >> checking whether make sets $(MAKE)... yes >> checking for a sed that does not truncate output... /bin/sed >> checking for grep that handles long lines and -e... /bin/grep >> checking for occurence(s) of link_all_deplibs = no in >> ./config/libtool.m4... none >> checking for gcc... gcc >> checking whether the C compiler works... yes >> checking for C compiler default output file name... a.out >> .checking for suffix of executables... >> checking whether we are cross compiling... no >> checking for suffix of object files... o >> checking whether we are using the GNU C compiler... yes >> checking whether gcc accepts -g... yes >> checking for gcc option to accept ISO C89... none needed >> checking for style of include used by make... GNU >> checking dependency style of gcc... gcc3 >> checking for g++... g++ >> checking whether we are using the GNU C++ compiler... yes >> checking whether g++ accepts -g... yes >> checking dependency style of g++... gcc3 >> checking whether make sets $(MAKE)... (cached) yes >> checking how to print strings... printf >> checking for a sed that does not truncate output... (cached) /bin/sed >> checking for egrep... /bin/grep -E >> checking for fgrep... /bin/grep -F >> checking for ld used by gcc... /usr/i686-pc-linux-gnu/bin/ld >> checking if the linker (/usr/i686-pc-linux-gnu/bin/ld) is GNU ld... yes >> checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B >> checking the name lister (/usr/bin/nm -B) interface... BSD nm >> checking whether ln -s works... yes >> checking the maximum length of command line arguments... 1572864 >> checking whether the shell understands some XSI constructs... yes >> checking whether the shell understands "+="... yes >> checking for /usr/i686-pc-linux-gnu/bin/ld option to reload object files... >> -r >> checking for objdump... objdump >> checking how to recognize dependent libraries... pass_all >> checking for ar... ar >> checking for strip... strip >> checking for ranlib... ranlib >> checking command to parse /usr/bin/nm -B output from gcc object... ok >> checking how to run the C preprocessor... gcc -E >> checking for ANSI C header files... yes >> checking for sys/types.h... yes >> checking for sys/stat.h... yes >> checking for stdlib.h... yes >> checking for string.h... yes >> checking for memory.h... yes >> checking for strings.h... yes >> checking for inttypes.h... yes >> checking for stdint.h... yes >> checking for unistd.h... yes >> checking for dlfcn.h... yes >> checking for objdir... .libs >> checking if gcc supports -fno-rtti -fno-exceptions... no >> checking for gcc option to produce PIC... -fPIC -DPIC >> checking if gcc PIC flag -fPIC -DPIC works... yes >> checking if gcc static flag -static works... yes >> checking if gcc supports -c -o file.o... yes >> checking if gcc supports -c -o file.o... (cached) yes >> checking whether the gcc linker (/usr/i686-pc-linux-gnu/bin/ld) supports >> shared libraries... yes >> checking whether -lc should be explicitly linked in... no >> checking dynamic linker characteristics... GNU/Linux ld.so >> checking how to hardcode library paths into programs... immediate >> checking whether stripping libraries is possible... yes >> checking if libtool supports shared libraries... yes >> checking whether to build shared libraries... yes >> checking whether to build static libraries... yes >> checking how to run the C++ preprocessor... g++ -E >> checking for ld used by g++... /usr/i686-pc-linux-gnu/bin/ld >> checking if the linker (/usr/i686-pc-linux-gnu/bin/ld) is GNU ld... yes >> checking whether the g++ linker (/usr/i686-pc-linux-gnu/bin/ld) supports >> shared libraries... yes >> checking for g++ option to produce PIC... -fPIC -DPIC >> checking if g++ PIC flag -fPIC -DPIC works... yes >> checking if g++ static flag -static works... yes >> checking if g++ supports -c -o file.o... yes >> checking if g++ supports -c -o file.o... (cached) yes >> checking whether the g++ linker (/usr/i686-pc-linux-gnu/bin/ld) supports >> shared libraries... yes >> checking dynamic linker characteristics... (cached) GNU/Linux ld.so >> checking how to hardcode library paths into programs... immediate >> checking whether the C++ compiler works... yes >> checking for dlopen in -ldl... yes >> checking for pthread_create in -lpthread... yes >> checking for uuid_generate in -luuid... yes >> checking for inline... inline >> checking for stdlib.h... (cached) yes >> checking for GNU libc compatible malloc... yes >> checking for gettimeofday... yes checking for munmap... yes >> checking for socket... yes >> checking for strerror... yes >> checking for strtol... yes >> checking for sched_getcpu... yes >> checking for sysconf... yes >> checking urcu-bp.h usability... yes >> checking urcu-bp.h presence... yes >> checking for urcu-bp.h... yes >> checking for _cds_lfht_new in -lurcu-cds... yes >> checking caa_likely()... yes >> checking for synchronize_rcu_bp in -lurcu-bp... no >> configure: error: Cannot find liburcu-bp lib. Use LDFLAGS=-Ldir to specify >> its location. >> >> Why this error? >> Is LTTng-ust not stabile? >> Kind regards. >> Vanni Genua > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev From vannigenua at gmail.com Mon Feb 18 10:49:53 2013 From: vannigenua at gmail.com (Vanni Genua) Date: Mon, 18 Feb 2013 16:49:53 +0100 Subject: [lttng-dev] lttng-tools : undefined reference to rcu_read_lock_mb Message-ID: After having installed on an Intel x86 platform lttng-modules, userspace-rcu, lttng-ust, I tried to install LTTng-tools but I get the following error, why? > 1) > lttng-tools # ./bootstrap > + '[' '!' -e config ']' > + autoreconf -i > 2) > lttng-tools # ./configure > checking build system type... i686-pc-linux-gnu > checking host system type... i686-pc-linux-gnu > checking target system type... i686-pc-linux-gnu > checking for a BSD-compatible install... /usr/bin/install -c > checking whether build environment is sane... yes > checking for a thread-safe mkdir -p... /bin/mkdir -p > checking for gawk... gawk > checking whether make sets $(MAKE)... yes > checking for grep that handles long lines and -e... /bin/grep > checking for occurence(s) of link_all_deplibs = no in ./config/libtool.m4... none > checking for style of include used by make... GNU > checking for gcc... gcc > checking whether the C compiler works... yes > checking for C compiler default output file name... a.out > checking for suffix of executables... > checking whether we are cross compiling... no > checking for suffix of object files... o > checking whether we are using the GNU C compiler... yes > checking whether gcc accepts -g... yes > checking for gcc option to accept ISO C89... none needed > checking dependency style of gcc... gcc3 > checking how to run the C preprocessor... gcc -E > checking for egrep... /bin/grep -E > checking for ANSI C header files... yes > checking for sys/types.h... yes > checking for sys/stat.h... yes > checking for stdlib.h... yes > checking for string.h... yes > checking for memory.h... yes > checking for strings.h... yes > checking for inttypes.h... yes > checking for stdint.h... yes > checking for unistd.h... yes > checking for sys/types.h... (cached) yes > checking for unistd.h... (cached) yes > checking fcntl.h usability... yes > checking fcntl.h presence... yes > checking for fcntl.h... yes > checking for string.h... (cached) yes > checking pthread.h usability... yes > checking pthread.h presence... yes > checking for pthread.h... yes > checking limits.h usability... yes > checking limits.h presence... yes > checking for limits.h... yes > checking signal.h usability... yes > checking signal.h presence... yes > checking for signal.h... yes > checking for stdlib.h... (cached) yes > checking sys/un.h usability... yes > checking sys/un.h presence... yes > checking for sys/un.h... yes > checking sys/socket.h usability... yes > checking sys/socket.h presence... yes > checking for sys/socket.h... yes > checking for stdlib.h... (cached) yes > checking stdio.h usability... yes > checking stdio.h presence... yes > checking for stdio.h... yes > checking getopt.h usability... yes > checking getopt.h presence... yes > checking for getopt.h... yes > checking sys/ipc.h usability... yes > checking sys/ipc.h presence... yes > checking for sys/ipc.h... yes > checking sys/shm.h usability... yes > checking sys/shm.h presence... yes > checking for sys/shm.h... yes > checking popt.h usability... yes > checking popt.h presence... yes > checking for popt.h... yes > checking grp.h usability... yes > checking grp.h presence... yes > checking for grp.h... yes > checking for pthread_create in -lpthread... yes > checking for poptGetContext in -lpopt... yes > checking whether cds_list_add is declared... yes > checking whether cds_wfq_init is declared... yes > checking whether cds_wfq_dequeue_blocking is declared... yes > checking whether futex_async is declared... yes > checking whether rcu_thread_offline is declared... yes > checking whether rcu_thread_online is declared... yes > checking whether caa_likely is declared... yes > checking for ustctl_set_filter in -llttng-ust-ctl... yes > checking for sched_getcpu... yes > checking for sysconf... yes > checking for sync_file_range... yes > checking for dlopen in -ldl... yes > checking for fmemopen in -lc... yes > checking for open_memstream in -lc... yes > configure: You may configure with --enable-python-bindings if you want Python bindings. > checking linux/version.h usability... yes > checking linux/version.h presence... yes > checking for linux/version.h... yes > checking for Linux epoll(7) interface... yes > checking for special C compiler options needed for large files... no > checking for _FILE_OFFSET_BITS value needed for large files... 64 > checking for gcc... (cached) gcc > checking whether we are using the GNU C compiler... (cached) yes > checking whether gcc accepts -g... (cached) yes > checking for gcc option to accept ISO C89... (cached) none needed > checking dependency style of gcc... (cached) gcc3 > checking how to print strings... printf > checking for a sed that does not truncate output... /bin/sed > checking for fgrep... /bin/grep -F > checking for ld used by gcc... /usr/i686-pc-linux-gnu/bin/ld > checking if the linker (/usr/i686-pc-linux-gnu/bin/ld) is GNU ld... yes > checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B > checking the name lister (/usr/bin/nm -B) interface... BSD nm > checking whether ln -s works... yes > checking the maximum length of command line arguments... 1572864 > checking whether the shell understands some XSI constructs... yes > checking whether the shell understands "+="... yes > checking for /usr/i686-pc-linux-gnu/bin/ld option to reload object files... -r > checking for objdump... objdump > checking how to recognize dependent libraries... pass_all > checking for ar... ar > checking for strip... strip > checking for ranlib... ranlib > checking command to parse /usr/bin/nm -B output from gcc object... ok > checking for dlfcn.h... yes > checking for objdir... .libs > checking if gcc supports -fno-rtti -fno-exceptions... no > checking for gcc option to produce PIC... -fPIC -DPIC > checking if gcc PIC flag -fPIC -DPIC works... yes > checking if gcc static flag -static works... yes > checking if gcc supports -c -o file.o... yes > checking if gcc supports -c -o file.o... (cached) yes > checking whether the gcc linker (/usr/i686-pc-linux-gnu/bin/ld) supports shared libraries... yes > checking whether -lc should be explicitly linked in... no > checking dynamic linker characteristics... GNU/Linux ld.so > checking how to hardcode library paths into programs... immediate > checking whether stripping libraries is possible... yes > checking if libtool supports shared libraries... yes > checking whether to build shared libraries... yes > checking whether to build static libraries... yes > checking for bison... bison -y > checking for flex... flex > checking lex output file root... lex.yy > checking lex library... -lfl > checking whether yytext is a pointer... yes > configure: creating ./config.status > config.status: creating Makefile > config.status: creating doc/Makefile > config.status: creating doc/man/Makefile > config.status: creating include/Makefile > config.status: creating extras/Makefile > config.status: creating extras/bindings/Makefile > config.status: creating extras/bindings/swig/Makefile > config.status: creating extras/bindings/swig/python/Makefile > config.status: creating src/Makefile > config.status: creating src/common/Makefile > config.status: creating src/common/kernel-ctl/Makefile > config.status: creating src/common/kernel-consumer/Makefile > config.status: creating src/common/ust-consumer/Makefile > config.status: creating src/common/hashtable/Makefile > config.status: creating src/common/sessiond-comm/Makefile > config.status: creating src/common/compat/Makefile > config.status: creating src/common/relayd/Makefile > config.status: creating src/common/testpoint/Makefile > config.status: creating src/lib/Makefile > config.status: creating src/lib/lttng-ctl/Makefile > config.status: creating src/lib/lttng-ctl/filter/Makefile > config.status: creating src/lib/lttng-ctl/lttng-ctl.pc > config.status: creating src/bin/Makefile > config.status: creating src/bin/lttng-consumerd/Makefile > config.status: creating src/bin/lttng-sessiond/Makefile > config.status: creating src/bin/lttng-relayd/Makefile > config.status: creating src/bin/lttng/Makefile > config.status: creating tests/Makefile > config.status: creating tests/kernel/Makefile > config.status: creating tests/tools/Makefile > config.status: creating tests/tools/streaming/Makefile > config.status: creating tests/tools/filtering/Makefile > config.status: creating tests/tools/health/Makefile > config.status: creating tests/ust/Makefile > config.status: creating tests/ust/nprocesses/Makefile > config.status: creating tests/ust/high-throughput/Makefile > config.status: creating tests/ust/low-throughput/Makefile > config.status: creating tests/ust/before-after/Makefile > config.status: creating tests/ust/multi-session/Makefile > config.status: creating tests/ust/overlap/Makefile > config.status: creating tests/ust/overlap/demo/Makefile > config.status: creating include/config.h > config.status: include/config.h is unchanged > config.status: executing depfiles commands > config.status: executing libtool commands > > Version name: Basse Messe > Light coloured German ale whose style was named after the city Cologne (Koln) where it was first brewed. It is a rather simple beer with lightly fruity aromas and a delicate hoppy fragrance. The beer has a pronounced malty taste with a subtle bitter aftertaste > > Target architecture: i686 > Lttng-UST support: Enabled > Python binding: Disabled > All binaries will be built. > > Binaries will be installed in: /usr/local/bin > Libraries will be installed in: /usr/local/lib > > The sessiond daemon will look in the following directories: > 32-bit consumerd executable at: /usr/local/lib/lttng/libexec/lttng-consumerd > 32-bit consumer libraries in: /usr/local/lib > 64-bit consumerd executable at: /usr/local/lib/lttng/libexec/lttng-consumerd > 64-bit consumer libraries in: /usr/local/lib > > 3) lttng-tools # make > Making all in src > make[1]: Entering directory `/usr/src/LTTng/lttng-tools/src' > Making all in common > make[2]: Entering directory `/usr/src/LTTng/lttng-tools/src/common' > Making all in compat > make[3]: Entering directory `/usr/src/LTTng/lttng-tools/src/common/compat' > CC compat-fcntl.lo > CC compat-epoll.lo > CCLD libcompat.la > make[3]: Leaving directory `/usr/src/LTTng/lttng-tools/src/common/compat' > Making all in hashtable > make[3]: Entering directory `/usr/src/LTTng/lttng-tools/src/common/hashtable' > CC hashtable.lo > CC utils.lo > CC rculfhash.lo > CC rculfhash-mm-chunk.lo > CC rculfhash-mm-mmap.lo > CC rculfhash-mm-order.lo > CCLD libhashtable.la > make[3]: Leaving directory `/usr/src/LTTng/lttng-tools/src/common/hashtable' > Making all in kernel-ctl > make[3]: Entering directory `/usr/src/LTTng/lttng-tools/src/common/kernel-ctl' > CC kernel-ctl.lo > CCLD libkernel-ctl.la > make[3]: Leaving directory `/usr/src/LTTng/lttng-tools/src/common/kernel-ctl' > Making all in sessiond-comm > make[3]: Entering directory `/usr/src/LTTng/lttng-tools/src/common/sessiond-comm' > CC sessiond-comm.lo > CC unix.lo > CC inet.lo > CC inet6.lo > CCLD libsessiond-comm.la > make[3]: Leaving directory `/usr/src/LTTng/lttng-tools/src/common/sessiond-comm' > Making all in relayd > make[3]: Entering directory `/usr/src/LTTng/lttng-tools/src/common/relayd' > CC relayd.lo > relayd.c: In function 'recv_reply': > relayd.c:90: warning: format '%ld' expects type 'long int', but argument 3 has type 'size_t' > relayd.c:90: warning: format '%ld' expects type 'long int', but argument 3 has type 'size_t' > relayd.c:90: warning: format '%ld' expects type 'long int', but argument 3 has type 'size_t' > relayd.c:90: warning: format '%ld' expects type 'long int', but argument 3 has type 'size_t' > relayd.c:98: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'size_t' > relayd.c:98: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'size_t' > relayd.c:98: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'size_t' > relayd.c:98: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'size_t' > relayd.c: In function 'relayd_send_data_hdr': > relayd.c:353: warning: format '%ld' expects type 'long int', but argument 3 has type 'size_t' > relayd.c:353: warning: format '%ld' expects type 'long int', but argument 3 has type 'size_t' > relayd.c:353: warning: format '%ld' expects type 'long int', but argument 3 has type 'size_t' > relayd.c:353: warning: format '%ld' expects type 'long int', but argument 3 has type 'size_t' > CCLD librelayd.la > make[3]: Leaving directory `/usr/src/LTTng/lttng-tools/src/common/relayd' > Making all in kernel-consumer > make[3]: Entering directory `/usr/src/LTTng/lttng-tools/src/common/kernel-consumer' > CC kernel-consumer.lo > CCLD libkernel-consumer.la > make[3]: Leaving directory `/usr/src/LTTng/lttng-tools/src/common/kernel-consumer' > Making all in ust-consumer > make[3]: Entering directory `/usr/src/LTTng/lttng-tools/src/common/ust-consumer' > CC ust-consumer.lo > ust-consumer.c: In function 'lttng_ustconsumer_read_subbuffer': > ust-consumer.c:562: warning: format '%zd' expects type 'signed size_t', but argument 3 has type 'long int' > ust-consumer.c:562: warning: format '%zd' expects type 'signed size_t', but argument 3 has type 'long int' > ust-consumer.c:562: warning: format '%zd' expects type 'signed size_t', but argument 3 has type 'long int' > ust-consumer.c:562: warning: format '%zd' expects type 'signed size_t', but argument 3 has type 'long int' > CCLD libust-consumer.la > make[3]: Leaving directory `/usr/src/LTTng/lttng-tools/src/common/ust-consumer' > Making all in testpoint > make[3]: Entering directory `/usr/src/LTTng/lttng-tools/src/common/testpoint' > CC testpoint.lo > CCLD libtestpoint.la > make[3]: Leaving directory `/usr/src/LTTng/lttng-tools/src/common/testpoint' > make[3]: Entering directory `/usr/src/LTTng/lttng-tools/src/common' > CC error.lo > CC utils.lo > CC runas.lo > CC futex.lo > CC uri.lo > CC defaults.lo > CCLD libcommon.la > CC consumer.lo > consumer.c: In function 'consumer_add_relayd_socket': > consumer.c:2707: warning: 'relayd' may be used uninitialized in this function > CCLD libconsumer.la > copying selected object files to avoid basename conflicts... > make[3]: Leaving directory `/usr/src/LTTng/lttng-tools/src/common' > make[2]: Leaving directory `/usr/src/LTTng/lttng-tools/src/common' > Making all in lib > make[2]: Entering directory `/usr/src/LTTng/lttng-tools/src/lib' > Making all in lttng-ctl > make[3]: Entering directory `/usr/src/LTTng/lttng-tools/src/lib/lttng-ctl' > Making all in filter > make[4]: Entering directory `/usr/src/LTTng/lttng-tools/src/lib/lttng-ctl/filter' > YACC filter-parser.c > updating filter-parser.h > updating filter-parser.output > make all-am > make[5]: Entering directory `/usr/src/LTTng/lttng-tools/src/lib/lttng-ctl/filter' > LEX filter-lexer.c > CC libfilter_la-filter-lexer.lo > filter-lexer.c: In function 'yylex': > filter-lexer.l:136: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result > CC libfilter_la-filter-parser.lo > CC libfilter_la-filter-visitor-set-parent.lo > CC libfilter_la-filter-visitor-xml.lo > CC libfilter_la-filter-visitor-generate-ir.lo > CC libfilter_la-filter-visitor-ir-check-binary-op-nesting.lo > CC libfilter_la-filter-visitor-generate-bytecode.lo > CCLD libfilter.la > CC filter-grammar-test.o > CCLD filter-grammar-test > make[5]: Leaving directory `/usr/src/LTTng/lttng-tools/src/lib/lttng-ctl/filter' > make[4]: Leaving directory `/usr/src/LTTng/lttng-tools/src/lib/lttng-ctl/filter' > make[4]: Entering directory `/usr/src/LTTng/lttng-tools/src/lib/lttng-ctl' > CC lttng-ctl.lo > CCLD liblttng-ctl.la > copying selected object files to avoid basename conflicts... > make[4]: Leaving directory `/usr/src/LTTng/lttng-tools/src/lib/lttng-ctl' > make[3]: Leaving directory `/usr/src/LTTng/lttng-tools/src/lib/lttng-ctl' > make[3]: Entering directory `/usr/src/LTTng/lttng-tools/src/lib' > make[3]: Nothing to be done for `all-am'. > make[3]: Leaving directory `/usr/src/LTTng/lttng-tools/src/lib' > make[2]: Leaving directory `/usr/src/LTTng/lttng-tools/src/lib' > Making all in bin > make[2]: Entering directory `/usr/src/LTTng/lttng-tools/src/bin' > Making all in lttng-consumerd > make[3]: Entering directory `/usr/src/LTTng/lttng-tools/src/bin/lttng-consumerd' > CC lttng-consumerd.o > CCLD lttng-consumerd > /usr/lib/gcc/i686-pc-linux-gnu/4.4.4/../../../../i686-pc-linux-gnu/bin/ld: warning: liburcu-common.so.1, needed by /usr/local/lib/liblttng-ust-ctl.so, may conflict with liburcu-common.so.2 > ../../../src/common/.libs/libconsumer.a(consumer.o): In function `consumer_data_pending': > /usr/src/LTTng/lttng-tools/src/common/consumer.c:2921: undefined reference to `rcu_read_lock_mb' > /usr/src/LTTng/lttng-tools/src/common/consumer.c:3030: undefined reference to `rcu_read_unlock_mb' > /usr/src/LTTng/lttng-tools/src/common/consumer.c:3024: undefined reference to `rcu_read_unlock_mb' > ../../../src/common/.libs/libconsumer.a(consumer.o): In function `consumer_steal_stream_key': > /usr/src/LTTng/lttng-tools/src/common/consumer.c:116: undefined reference to `rcu_read_lock_mb' > ../../../src/common/.libs/libconsumer.a(consumer.o): In function `consumer_find_stream': > /usr/src/LTTng/lttng-tools/src/common/consumer.c:99: undefined reference to `rcu_read_lock_mb' > /usr/src/LTTng/lttng-tools/src/common/consumer.c:107: undefined reference to `rcu_read_unlock_mb' > ../../../src/common/.libs/libconsumer.a(consumer.o): In function `consumer_steal_stream_key': > /usr/src/LTTng/lttng-tools/src/common/consumer.c:127: undefined reference to `rcu_read_unlock_mb' > ../../../src/common/.libs/libconsumer.a(consumer.o): In function `consumer_find_stream': > /usr/src/LTTng/lttng-tools/src/common/consumer.c:107: undefined reference to `rcu_read_unlock_mb' > ../../../src/common/.libs/libconsumer.a(consumer.o): In function `consumer_steal_channel_key': > /usr/src/LTTng/lttng-tools/src/common/consumer.c:161: undefined reference to `rcu_read_lock_mb' > /usr/src/LTTng/lttng-tools/src/common/consumer.c:172: undefined reference to `rcu_read_unlock_mb' > ../../../src/common/.libs/libconsumer.a(consumer.o): In function `consumer_add_channel': > /usr/src/LTTng/lttng-tools/src/common/consumer.c:905: undefined reference to `rcu_read_lock_mb' > /usr/src/LTTng/lttng-tools/src/common/consumer.c:918: undefined reference to `rcu_read_unlock_mb' > ../../../src/common/.libs/libconsumer.a(consumer.o): In function `destroy_relayd': > /usr/src/LTTng/lttng-tools/src/common/consumer.c:234: undefined reference to `call_rcu_mb' > ../../../src/common/.libs/libconsumer.a(consumer.o): In function `consumer_thread_sessiond_poll': > /usr/src/LTTng/lttng-tools/src/common/consumer.c:2523: undefined reference to `rcu_register_thread_mb' > /usr/src/LTTng/lttng-tools/src/common/consumer.c:2639: undefined reference to `rcu_unregister_thread_mb' > ../../../src/common/.libs/libconsumer.a(consumer.o): In function `consumer_del_channel': > /usr/src/LTTng/lttng-tools/src/common/consumer.c:814: undefined reference to `rcu_read_lock_mb' > /usr/src/LTTng/lttng-tools/src/common/consumer.c:818: undefined reference to `rcu_read_unlock_mb' > /usr/src/LTTng/lttng-tools/src/common/consumer.c:839: undefined reference to `call_rcu_mb' > ../../../src/common/.libs/libconsumer.a(consumer.o): In function `consumer_del_metadata_stream': > /usr/src/LTTng/lttng-tools/src/common/consumer.c:1853: undefined reference to `rcu_read_lock_mb' > /usr/src/LTTng/lttng-tools/src/common/consumer.c:1862: undefined reference to `rcu_read_unlock_mb' > /usr/src/LTTng/lttng-tools/src/common/consumer.c:1886: undefined reference to `rcu_read_lock_mb' > /usr/src/LTTng/lttng-tools/src/common/consumer.c:1912: undefined reference to `rcu_read_unlock_mb' > /usr/src/LTTng/lttng-tools/src/common/consumer.c:1931: undefined reference to `call_rcu_mb' > ../../../src/common/.libs/libconsumer.a(consumer.o): In function `consumer_thread_metadata_poll': > /usr/src/LTTng/lttng-tools/src/common/consumer.c:2073: undefined reference to `rcu_register_thread_mb' > ../../../src/common/.libs/libconsumer.a(consumer.o): In function `destroy_stream_ht': > /usr/src/LTTng/lttng-tools/src/common/consumer.c:1793: undefined reference to `rcu_read_lock_mb' > /usr/src/LTTng/lttng-tools/src/common/consumer.c:1801: undefined reference to `rcu_read_unlock_mb' > ../../../src/common/.libs/libconsumer.a(consumer.o): In function `consumer_thread_metadata_poll': > /usr/src/LTTng/lttng-tools/src/common/consumer.c:2247: undefined reference to `rcu_unregister_thread_mb' > /usr/src/LTTng/lttng-tools/src/common/consumer.c:2183: undefined reference to `rcu_read_lock_mb' > /usr/src/LTTng/lttng-tools/src/common/consumer.c:2236: undefined reference to `rcu_read_unlock_mb' > ../../../src/common/.libs/libconsumer.a(consumer.o): In function `consumer_add_metadata_stream': > /usr/src/LTTng/lttng-tools/src/common/consumer.c:1959: undefined reference to `rcu_read_lock_mb' > /usr/src/LTTng/lttng-tools/src/common/consumer.c:1998: undefined reference to `rcu_read_unlock_mb' > ../../../src/common/.libs/libconsumer.a(consumer.o): In function `validate_endpoint_status_metadata_stream': > /usr/src/LTTng/lttng-tools/src/common/consumer.c:2040: undefined reference to `rcu_read_lock_mb' > /usr/src/LTTng/lttng-tools/src/common/consumer.c:2055: undefined reference to `rcu_read_unlock_mb' > ../../../src/common/.libs/libconsumer.a(consumer.o): In function `lttng_consumer_cleanup': > /usr/src/LTTng/lttng-tools/src/common/consumer.c:1044: undefined reference to `rcu_read_lock_mb' > /usr/src/LTTng/lttng-tools/src/common/consumer.c:1053: undefined reference to `rcu_read_unlock_mb' > ../../../src/common/.libs/libconsumer.a(consumer.o): In function `cleanup_relayd_ht': > /usr/src/LTTng/lttng-tools/src/common/consumer.c:246: undefined reference to `rcu_read_lock_mb' > /usr/src/LTTng/lttng-tools/src/common/consumer.c:255: undefined reference to `rcu_read_unlock_mb' > ../../../src/common/.libs/libconsumer.a(consumer.o): In function `consumer_del_stream': > /usr/src/LTTng/lttng-tools/src/common/consumer.c:396: undefined reference to `rcu_read_lock_mb' > /usr/src/LTTng/lttng-tools/src/common/consumer.c:405: undefined reference to `rcu_read_unlock_mb' > /usr/src/LTTng/lttng-tools/src/common/consumer.c:430: undefined reference to `rcu_read_lock_mb' > /usr/src/LTTng/lttng-tools/src/common/consumer.c:457: undefined reference to `rcu_read_unlock_mb' > /usr/src/LTTng/lttng-tools/src/common/consumer.c:475: undefined reference to `call_rcu_mb' > ../../../src/common/.libs/libconsumer.a(consumer.o): In function `consumer_thread_data_poll': > /usr/src/LTTng/lttng-tools/src/common/consumer.c:2266: undefined reference to `rcu_register_thread_mb' > ../../../src/common/.libs/libconsumer.a(consumer.o): In function `consumer_update_poll_array': > /usr/src/LTTng/lttng-tools/src/common/consumer.c:940: undefined reference to `rcu_read_lock_mb' > /usr/src/LTTng/lttng-tools/src/common/consumer.c:961: undefined reference to `rcu_read_unlock_mb' > ../../../src/common/.libs/libconsumer.a(consumer.o): In function `destroy_data_stream_ht': > /usr/src/LTTng/lttng-tools/src/common/consumer.c:1766: undefined reference to `rcu_read_lock_mb' > /usr/src/LTTng/lttng-tools/src/common/consumer.c:1774: undefined reference to `rcu_read_unlock_mb' > ../../../src/common/.libs/libconsumer.a(consumer.o): In function `consumer_thread_data_poll': > /usr/src/LTTng/lttng-tools/src/common/consumer.c:2505: undefined reference to `rcu_unregister_thread_mb' > ../../../src/common/.libs/libconsumer.a(consumer.o): In function `consumer_add_stream': > /usr/src/LTTng/lttng-tools/src/common/consumer.c:586: undefined reference to `rcu_read_lock_mb' > /usr/src/LTTng/lttng-tools/src/common/consumer.c:624: undefined reference to `rcu_read_unlock_mb' > ../../../src/common/.libs/libconsumer.a(consumer.o): In function `validate_endpoint_status_data_stream': > /usr/src/LTTng/lttng-tools/src/common/consumer.c:2015: undefined reference to `rcu_read_lock_mb' > /usr/src/LTTng/lttng-tools/src/common/consumer.c:2024: undefined reference to `rcu_read_unlock_mb' > ../../../src/common/.libs/libconsumer.a(consumer.o): In function `consumer_allocate_stream': > /usr/src/LTTng/lttng-tools/src/common/consumer.c:501: undefined reference to `rcu_read_lock_mb' > /usr/src/LTTng/lttng-tools/src/common/consumer.c:560: undefined reference to `rcu_read_unlock_mb' > /usr/src/LTTng/lttng-tools/src/common/consumer.c:564: undefined reference to `rcu_read_unlock_mb' > ../../../src/common/.libs/libconsumer.a(consumer.o): In function `update_endpoint_status_by_netidx': > /usr/src/LTTng/lttng-tools/src/common/consumer.c:273: undefined reference to `rcu_read_lock_mb' > /usr/src/LTTng/lttng-tools/src/common/consumer.c:290: undefined reference to `rcu_read_unlock_mb' > ../../../src/common/.libs/libconsumer.a(consumer.o): In function `lttng_consumer_on_read_subbuffer_splice': > /usr/src/LTTng/lttng-tools/src/common/consumer.c:1517: undefined reference to `rcu_read_lock_mb' > /usr/src/LTTng/lttng-tools/src/common/consumer.c:1687: undefined reference to `rcu_read_unlock_mb' > ../../../src/common/.libs/libconsumer.a(consumer.o): In function `lttng_consumer_on_read_subbuffer_mmap': > /usr/src/LTTng/lttng-tools/src/common/consumer.c:1345: undefined reference to `rcu_read_lock_mb' > /usr/src/LTTng/lttng-tools/src/common/consumer.c:1478: undefined reference to `rcu_read_unlock_mb' > ../../../src/common/.libs/libconsumer.a(kernel-consumer.o): In function `lttng_kconsumer_recv_cmd': > /usr/src/LTTng/lttng-tools/src/common/kernel-consumer/kernel-consumer.c:112: undefined reference to `rcu_read_lock_mb' > /usr/src/LTTng/lttng-tools/src/common/kernel-consumer/kernel-consumer.c:352: undefined reference to `rcu_read_unlock_mb' > /usr/src/LTTng/lttng-tools/src/common/kernel-consumer/kernel-consumer.c:287: undefined reference to `rcu_read_unlock_mb' > /usr/src/LTTng/lttng-tools/src/common/kernel-consumer/kernel-consumer.c:180: undefined reference to `rcu_read_unlock_mb' > /usr/src/LTTng/lttng-tools/src/common/kernel-consumer/kernel-consumer.c:172: undefined reference to `rcu_read_unlock_mb' > ../../../src/common/.libs/libconsumer.a(hashtable.o): In function `cds_lfht_new': > /usr/src/LTTng/lttng-tools/src/common/hashtable/rculfhash.h:167: undefined reference to `rcu_flavor_mb' > ../../../src/common/.libs/libconsumer.a(ust-consumer.o): In function `lttng_ustconsumer_recv_cmd': > /usr/src/LTTng/lttng-tools/src/common/ust-consumer/ust-consumer.c:131: undefined reference to `rcu_read_lock_mb' > /usr/src/LTTng/lttng-tools/src/common/ust-consumer/ust-consumer.c:406: undefined reference to `rcu_read_unlock_mb' > /usr/src/LTTng/lttng-tools/src/common/ust-consumer/ust-consumer.c:376: undefined reference to `rcu_read_unlock_mb' > /usr/src/LTTng/lttng-tools/src/common/ust-consumer/ust-consumer.c:232: undefined reference to `rcu_read_unlock_mb' > /usr/src/LTTng/lttng-tools/src/common/ust-consumer/ust-consumer.c:165: undefined reference to `rcu_read_unlock_mb' > /usr/src/LTTng/lttng-tools/src/common/ust-consumer/ust-consumer.c:226: undefined reference to `rcu_read_unlock_mb' > collect2: ld returned 1 exit status > make[3]: *** [lttng-consumerd] Error 1 > make[3]: Leaving directory `/usr/src/LTTng/lttng-tools/src/bin/lttng-consumerd' > make[2]: *** [all-recursive] Error 1 > make[2]: Leaving directory `/usr/src/LTTng/lttng-tools/src/bin' > make[1]: *** [all-recursive] Error 1 > make[1]: Leaving directory `/usr/src/LTTng/lttng-tools/src' > make: *** [all-recursive] Error 1 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeremie.galarneau at efficios.com Mon Feb 18 13:11:21 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Mon, 18 Feb 2013 13:11:21 -0500 Subject: [lttng-dev] lttng-tools : undefined reference to rcu_read_lock_mb In-Reply-To: References: Message-ID: It appears to be caused by a conflict between what you installed in /usr/local/lib and /usr/lib. Please make sure you uninstalled the libs in /usr/local/lib. You may do so by running ./configure without any option, which will set the default install path and then run "make uninstall". Regards, J?r?mie On Mon, Feb 18, 2013 at 10:49 AM, Vanni Genua wrote: > After having installed on an Intel x86 platform lttng-modules, > userspace-rcu, lttng-ust, I tried to install LTTng-tools but I get the > following error, why? > >> 1) >> lttng-tools # ./bootstrap >> + '[' '!' -e config ']' >> + autoreconf -i >> 2) >> lttng-tools # ./configure >> checking build system type... i686-pc-linux-gnu >> checking host system type... i686-pc-linux-gnu >> checking target system type... i686-pc-linux-gnu >> checking for a BSD-compatible install... /usr/bin/install -c >> checking whether build environment is sane... yes >> checking for a thread-safe mkdir -p... /bin/mkdir -p >> checking for gawk... gawk >> checking whether make sets $(MAKE)... yes >> checking for grep that handles long lines and -e... /bin/grep >> checking for occurence(s) of link_all_deplibs = no in >> ./config/libtool.m4... none >> checking for style of include used by make... GNU >> checking for gcc... gcc >> checking whether the C compiler works... yes >> checking for C compiler default output file name... a.out >> checking for suffix of executables... >> checking whether we are cross compiling... no >> checking for suffix of object files... o >> checking whether we are using the GNU C compiler... yes >> checking whether gcc accepts -g... yes >> checking for gcc option to accept ISO C89... none needed >> checking dependency style of gcc... gcc3 >> checking how to run the C preprocessor... gcc -E >> checking for egrep... /bin/grep -E >> checking for ANSI C header files... yes >> checking for sys/types.h... yes >> checking for sys/stat.h... yes >> checking for stdlib.h... yes >> checking for string.h... yes >> checking for memory.h... yes >> checking for strings.h... yes >> checking for inttypes.h... yes >> checking for stdint.h... yes >> checking for unistd.h... yes >> checking for sys/types.h... (cached) yes >> checking for unistd.h... (cached) yes >> checking fcntl.h usability... yes >> checking fcntl.h presence... yes >> checking for fcntl.h... yes >> checking for string.h... (cached) yes >> checking pthread.h usability... yes >> checking pthread.h presence... yes >> checking for pthread.h... yes >> checking limits.h usability... yes >> checking limits.h presence... yes >> checking for limits.h... yes >> checking signal.h usability... yes >> checking signal.h presence... yes >> checking for signal.h... yes >> checking for stdlib.h... (cached) yes >> checking sys/un.h usability... yes >> checking sys/un.h presence... yes >> checking for sys/un.h... yes >> checking sys/socket.h usability... yes >> checking sys/socket.h presence... yes >> checking for sys/socket.h... yes >> checking for stdlib.h... (cached) yes >> checking stdio.h usability... yes >> checking stdio.h presence... yes >> checking for stdio.h... yes >> checking getopt.h usability... yes >> checking getopt.h presence... yes >> checking for getopt.h... yes >> checking sys/ipc.h usability... yes >> checking sys/ipc.h presence... yes >> checking for sys/ipc.h... yes >> checking sys/shm.h usability... yes >> checking sys/shm.h presence... yes >> checking for sys/shm.h... yes >> checking popt.h usability... yes >> checking popt.h presence... yes >> checking for popt.h... yes >> checking grp.h usability... yes >> checking grp.h presence... yes >> checking for grp.h... yes >> checking for pthread_create in -lpthread... yes >> checking for poptGetContext in -lpopt... yes >> checking whether cds_list_add is declared... yes >> checking whether cds_wfq_init is declared... yes >> checking whether cds_wfq_dequeue_blocking is declared... yes >> checking whether futex_async is declared... yes >> checking whether rcu_thread_offline is declared... yes >> checking whether rcu_thread_online is declared... yes >> checking whether caa_likely is declared... yes >> checking for ustctl_set_filter in -llttng-ust-ctl... yes >> checking for sched_getcpu... yes >> checking for sysconf... yes >> checking for sync_file_range... yes >> checking for dlopen in -ldl... yes >> checking for fmemopen in -lc... yes >> checking for open_memstream in -lc... yes >> configure: You may configure with --enable-python-bindings if you want >> Python bindings. >> checking linux/version.h usability... yes >> checking linux/version.h presence... yes >> checking for linux/version.h... yes >> checking for Linux epoll(7) interface... yes >> checking for special C compiler options needed for large files... no >> checking for _FILE_OFFSET_BITS value needed for large files... 64 >> checking for gcc... (cached) gcc >> checking whether we are using the GNU C compiler... (cached) yes >> checking whether gcc accepts -g... (cached) yes >> checking for gcc option to accept ISO C89... (cached) none needed >> checking dependency style of gcc... (cached) gcc3 >> checking how to print strings... printf >> checking for a sed that does not truncate output... /bin/sed >> checking for fgrep... /bin/grep -F >> checking for ld used by gcc... /usr/i686-pc-linux-gnu/bin/ld >> checking if the linker (/usr/i686-pc-linux-gnu/bin/ld) is GNU ld... yes >> checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B >> checking the name lister (/usr/bin/nm -B) interface... BSD nm >> checking whether ln -s works... yes >> checking the maximum length of command line arguments... 1572864 >> checking whether the shell understands some XSI constructs... yes >> checking whether the shell understands "+="... yes >> checking for /usr/i686-pc-linux-gnu/bin/ld option to reload object >> files... -r >> checking for objdump... objdump >> checking how to recognize dependent libraries... pass_all >> checking for ar... ar >> checking for strip... strip >> checking for ranlib... ranlib >> checking command to parse /usr/bin/nm -B output from gcc object... ok >> checking for dlfcn.h... yes >> checking for objdir... .libs >> checking if gcc supports -fno-rtti -fno-exceptions... no >> checking for gcc option to produce PIC... -fPIC -DPIC >> checking if gcc PIC flag -fPIC -DPIC works... yes >> checking if gcc static flag -static works... yes >> checking if gcc supports -c -o file.o... yes >> checking if gcc supports -c -o file.o... (cached) yes >> checking whether the gcc linker (/usr/i686-pc-linux-gnu/bin/ld) supports >> shared libraries... yes >> checking whether -lc should be explicitly linked in... no >> checking dynamic linker characteristics... GNU/Linux ld.so >> checking how to hardcode library paths into programs... immediate >> checking whether stripping libraries is possible... yes >> checking if libtool supports shared libraries... yes >> checking whether to build shared libraries... yes >> checking whether to build static libraries... yes >> checking for bison... bison -y >> checking for flex... flex >> checking lex output file root... lex.yy >> checking lex library... -lfl >> checking whether yytext is a pointer... yes >> configure: creating ./config.status >> config.status: creating Makefile >> config.status: creating doc/Makefile >> config.status: creating doc/man/Makefile >> config.status: creating include/Makefile >> config.status: creating extras/Makefile >> config.status: creating extras/bindings/Makefile >> config.status: creating extras/bindings/swig/Makefile >> config.status: creating extras/bindings/swig/python/Makefile >> config.status: creating src/Makefile >> config.status: creating src/common/Makefile >> config.status: creating src/common/kernel-ctl/Makefile >> config.status: creating src/common/kernel-consumer/Makefile >> config.status: creating src/common/ust-consumer/Makefile >> config.status: creating src/common/hashtable/Makefile >> config.status: creating src/common/sessiond-comm/Makefile >> config.status: creating src/common/compat/Makefile >> config.status: creating src/common/relayd/Makefile >> config.status: creating src/common/testpoint/Makefile >> config.status: creating src/lib/Makefile >> config.status: creating src/lib/lttng-ctl/Makefile >> config.status: creating src/lib/lttng-ctl/filter/Makefile >> config.status: creating src/lib/lttng-ctl/lttng-ctl.pc >> config.status: creating src/bin/Makefile >> config.status: creating src/bin/lttng-consumerd/Makefile >> config.status: creating src/bin/lttng-sessiond/Makefile >> config.status: creating src/bin/lttng-relayd/Makefile >> config.status: creating src/bin/lttng/Makefile >> config.status: creating tests/Makefile >> config.status: creating tests/kernel/Makefile >> config.status: creating tests/tools/Makefile >> config.status: creating tests/tools/streaming/Makefile >> config.status: creating tests/tools/filtering/Makefile >> config.status: creating tests/tools/health/Makefile >> config.status: creating tests/ust/Makefile >> config.status: creating tests/ust/nprocesses/Makefile >> config.status: creating tests/ust/high-throughput/Makefile >> config.status: creating tests/ust/low-throughput/Makefile >> config.status: creating tests/ust/before-after/Makefile >> config.status: creating tests/ust/multi-session/Makefile >> config.status: creating tests/ust/overlap/Makefile >> config.status: creating tests/ust/overlap/demo/Makefile >> config.status: creating include/config.h >> config.status: include/config.h is unchanged >> config.status: executing depfiles commands >> config.status: executing libtool commands >> >> Version name: Basse Messe >> Light coloured German ale whose style was named after the city Cologne >> (Koln) where it was first brewed. It is a rather simple beer with lightly >> fruity aromas and a delicate hoppy fragrance. The beer has a pronounced >> malty taste with a subtle bitter aftertaste >> >> Target architecture: i686 >> Lttng-UST support: Enabled >> Python binding: Disabled >> All binaries will be built. >> >> Binaries will be installed in: /usr/local/bin >> Libraries will be installed in: /usr/local/lib >> >> The sessiond daemon will look in the following directories: >> 32-bit consumerd executable at: >> /usr/local/lib/lttng/libexec/lttng-consumerd >> 32-bit consumer libraries in: /usr/local/lib >> 64-bit consumerd executable at: >> /usr/local/lib/lttng/libexec/lttng-consumerd >> 64-bit consumer libraries in: /usr/local/lib >> >> 3) lttng-tools # make >> Making all in src >> make[1]: Entering directory `/usr/src/LTTng/lttng-tools/src' >> Making all in common >> make[2]: Entering directory `/usr/src/LTTng/lttng-tools/src/common' >> Making all in compat >> make[3]: Entering directory `/usr/src/LTTng/lttng-tools/src/common/compat' >> CC compat-fcntl.lo >> CC compat-epoll.lo >> CCLD libcompat.la >> make[3]: Leaving directory `/usr/src/LTTng/lttng-tools/src/common/compat' >> Making all in hashtable >> make[3]: Entering directory >> `/usr/src/LTTng/lttng-tools/src/common/hashtable' >> CC hashtable.lo >> CC utils.lo >> CC rculfhash.lo >> CC rculfhash-mm-chunk.lo >> CC rculfhash-mm-mmap.lo >> CC rculfhash-mm-order.lo >> CCLD libhashtable.la >> make[3]: Leaving directory >> `/usr/src/LTTng/lttng-tools/src/common/hashtable' >> Making all in kernel-ctl >> make[3]: Entering directory >> `/usr/src/LTTng/lttng-tools/src/common/kernel-ctl' >> CC kernel-ctl.lo >> CCLD libkernel-ctl.la >> make[3]: Leaving directory >> `/usr/src/LTTng/lttng-tools/src/common/kernel-ctl' >> Making all in sessiond-comm >> make[3]: Entering directory >> `/usr/src/LTTng/lttng-tools/src/common/sessiond-comm' >> CC sessiond-comm.lo >> CC unix.lo >> CC inet.lo >> CC inet6.lo >> CCLD libsessiond-comm.la >> make[3]: Leaving directory >> `/usr/src/LTTng/lttng-tools/src/common/sessiond-comm' >> Making all in relayd >> make[3]: Entering directory `/usr/src/LTTng/lttng-tools/src/common/relayd' >> CC relayd.lo >> relayd.c: In function 'recv_reply': >> relayd.c:90: warning: format '%ld' expects type 'long int', but argument 3 >> has type 'size_t' >> relayd.c:90: warning: format '%ld' expects type 'long int', but argument 3 >> has type 'size_t' >> relayd.c:90: warning: format '%ld' expects type 'long int', but argument 3 >> has type 'size_t' >> relayd.c:90: warning: format '%ld' expects type 'long int', but argument 3 >> has type 'size_t' >> relayd.c:98: warning: format '%lu' expects type 'long unsigned int', but >> argument 4 has type 'size_t' >> relayd.c:98: warning: format '%lu' expects type 'long unsigned int', but >> argument 4 has type 'size_t' >> relayd.c:98: warning: format '%lu' expects type 'long unsigned int', but >> argument 4 has type 'size_t' >> relayd.c:98: warning: format '%lu' expects type 'long unsigned int', but >> argument 4 has type 'size_t' >> relayd.c: In function 'relayd_send_data_hdr': >> relayd.c:353: warning: format '%ld' expects type 'long int', but argument >> 3 has type 'size_t' >> relayd.c:353: warning: format '%ld' expects type 'long int', but argument >> 3 has type 'size_t' >> relayd.c:353: warning: format '%ld' expects type 'long int', but argument >> 3 has type 'size_t' >> relayd.c:353: warning: format '%ld' expects type 'long int', but argument >> 3 has type 'size_t' >> CCLD librelayd.la >> make[3]: Leaving directory `/usr/src/LTTng/lttng-tools/src/common/relayd' >> Making all in kernel-consumer >> make[3]: Entering directory >> `/usr/src/LTTng/lttng-tools/src/common/kernel-consumer' >> CC kernel-consumer.lo >> CCLD libkernel-consumer.la >> make[3]: Leaving directory >> `/usr/src/LTTng/lttng-tools/src/common/kernel-consumer' >> Making all in ust-consumer >> make[3]: Entering directory >> `/usr/src/LTTng/lttng-tools/src/common/ust-consumer' >> CC ust-consumer.lo >> ust-consumer.c: In function 'lttng_ustconsumer_read_subbuffer': >> ust-consumer.c:562: warning: format '%zd' expects type 'signed size_t', >> but argument 3 has type 'long int' >> ust-consumer.c:562: warning: format '%zd' expects type 'signed size_t', >> but argument 3 has type 'long int' >> ust-consumer.c:562: warning: format '%zd' expects type 'signed size_t', >> but argument 3 has type 'long int' >> ust-consumer.c:562: warning: format '%zd' expects type 'signed size_t', >> but argument 3 has type 'long int' >> CCLD libust-consumer.la >> make[3]: Leaving directory >> `/usr/src/LTTng/lttng-tools/src/common/ust-consumer' >> Making all in testpoint >> make[3]: Entering directory >> `/usr/src/LTTng/lttng-tools/src/common/testpoint' >> CC testpoint.lo >> CCLD libtestpoint.la >> make[3]: Leaving directory >> `/usr/src/LTTng/lttng-tools/src/common/testpoint' >> make[3]: Entering directory `/usr/src/LTTng/lttng-tools/src/common' >> CC error.lo >> CC utils.lo >> CC runas.lo >> CC futex.lo >> CC uri.lo >> CC defaults.lo >> CCLD libcommon.la >> CC consumer.lo >> consumer.c: In function 'consumer_add_relayd_socket': >> consumer.c:2707: warning: 'relayd' may be used uninitialized in this >> function >> CCLD libconsumer.la >> copying selected object files to avoid basename conflicts... >> make[3]: Leaving directory `/usr/src/LTTng/lttng-tools/src/common' >> make[2]: Leaving directory `/usr/src/LTTng/lttng-tools/src/common' >> Making all in lib >> make[2]: Entering directory `/usr/src/LTTng/lttng-tools/src/lib' >> Making all in lttng-ctl >> make[3]: Entering directory `/usr/src/LTTng/lttng-tools/src/lib/lttng-ctl' >> Making all in filter >> make[4]: Entering directory >> `/usr/src/LTTng/lttng-tools/src/lib/lttng-ctl/filter' >> YACC filter-parser.c >> updating filter-parser.h >> updating filter-parser.output >> make all-am >> make[5]: Entering directory >> `/usr/src/LTTng/lttng-tools/src/lib/lttng-ctl/filter' >> LEX filter-lexer.c >> CC libfilter_la-filter-lexer.lo >> filter-lexer.c: In function 'yylex': >> filter-lexer.l:136: warning: ignoring return value of 'fwrite', declared >> with attribute warn_unused_result >> CC libfilter_la-filter-parser.lo >> CC libfilter_la-filter-visitor-set-parent.lo >> CC libfilter_la-filter-visitor-xml.lo >> CC libfilter_la-filter-visitor-generate-ir.lo >> CC libfilter_la-filter-visitor-ir-check-binary-op-nesting.lo >> CC libfilter_la-filter-visitor-generate-bytecode.lo >> CCLD libfilter.la >> CC filter-grammar-test.o >> CCLD filter-grammar-test >> make[5]: Leaving directory >> `/usr/src/LTTng/lttng-tools/src/lib/lttng-ctl/filter' >> make[4]: Leaving directory >> `/usr/src/LTTng/lttng-tools/src/lib/lttng-ctl/filter' >> make[4]: Entering directory `/usr/src/LTTng/lttng-tools/src/lib/lttng-ctl' >> CC lttng-ctl.lo >> CCLD liblttng-ctl.la >> copying selected object files to avoid basename conflicts... >> make[4]: Leaving directory `/usr/src/LTTng/lttng-tools/src/lib/lttng-ctl' >> make[3]: Leaving directory `/usr/src/LTTng/lttng-tools/src/lib/lttng-ctl' >> make[3]: Entering directory `/usr/src/LTTng/lttng-tools/src/lib' >> make[3]: Nothing to be done for `all-am'. >> make[3]: Leaving directory `/usr/src/LTTng/lttng-tools/src/lib' >> make[2]: Leaving directory `/usr/src/LTTng/lttng-tools/src/lib' >> Making all in bin >> make[2]: Entering directory `/usr/src/LTTng/lttng-tools/src/bin' >> Making all in lttng-consumerd >> make[3]: Entering directory >> `/usr/src/LTTng/lttng-tools/src/bin/lttng-consumerd' >> CC lttng-consumerd.o >> CCLD lttng-consumerd >> /usr/lib/gcc/i686-pc-linux-gnu/4.4.4/../../../../i686-pc-linux-gnu/bin/ld: >> warning: liburcu-common.so.1, needed by /usr/local/lib/liblttng-ust-ctl.so, >> may conflict with liburcu-common.so.2 >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function >> `consumer_data_pending': >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:2921: undefined reference >> to `rcu_read_lock_mb' >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:3030: undefined reference >> to `rcu_read_unlock_mb' >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:3024: undefined reference >> to `rcu_read_unlock_mb' >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function >> `consumer_steal_stream_key': >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:116: undefined reference >> to `rcu_read_lock_mb' >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function >> `consumer_find_stream': >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:99: undefined reference >> to `rcu_read_lock_mb' >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:107: undefined reference >> to `rcu_read_unlock_mb' >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function >> `consumer_steal_stream_key': >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:127: undefined reference >> to `rcu_read_unlock_mb' >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function >> `consumer_find_stream': >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:107: undefined reference >> to `rcu_read_unlock_mb' >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function >> `consumer_steal_channel_key': >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:161: undefined reference >> to `rcu_read_lock_mb' >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:172: undefined reference >> to `rcu_read_unlock_mb' >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function >> `consumer_add_channel': >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:905: undefined reference >> to `rcu_read_lock_mb' >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:918: undefined reference >> to `rcu_read_unlock_mb' >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function >> `destroy_relayd': >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:234: undefined reference >> to `call_rcu_mb' >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function >> `consumer_thread_sessiond_poll': >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:2523: undefined reference >> to `rcu_register_thread_mb' >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:2639: undefined reference >> to `rcu_unregister_thread_mb' >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function >> `consumer_del_channel': >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:814: undefined reference >> to `rcu_read_lock_mb' >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:818: undefined reference >> to `rcu_read_unlock_mb' >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:839: undefined reference >> to `call_rcu_mb' >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function >> `consumer_del_metadata_stream': >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:1853: undefined reference >> to `rcu_read_lock_mb' >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:1862: undefined reference >> to `rcu_read_unlock_mb' >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:1886: undefined reference >> to `rcu_read_lock_mb' >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:1912: undefined reference >> to `rcu_read_unlock_mb' >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:1931: undefined reference >> to `call_rcu_mb' >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function >> `consumer_thread_metadata_poll': >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:2073: undefined reference >> to `rcu_register_thread_mb' >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function >> `destroy_stream_ht': >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:1793: undefined reference >> to `rcu_read_lock_mb' >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:1801: undefined reference >> to `rcu_read_unlock_mb' >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function >> `consumer_thread_metadata_poll': >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:2247: undefined reference >> to `rcu_unregister_thread_mb' >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:2183: undefined reference >> to `rcu_read_lock_mb' >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:2236: undefined reference >> to `rcu_read_unlock_mb' >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function >> `consumer_add_metadata_stream': >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:1959: undefined reference >> to `rcu_read_lock_mb' >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:1998: undefined reference >> to `rcu_read_unlock_mb' >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function >> `validate_endpoint_status_metadata_stream': >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:2040: undefined reference >> to `rcu_read_lock_mb' >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:2055: undefined reference >> to `rcu_read_unlock_mb' >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function >> `lttng_consumer_cleanup': >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:1044: undefined reference >> to `rcu_read_lock_mb' >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:1053: undefined reference >> to `rcu_read_unlock_mb' >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function >> `cleanup_relayd_ht': >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:246: undefined reference >> to `rcu_read_lock_mb' >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:255: undefined reference >> to `rcu_read_unlock_mb' >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function >> `consumer_del_stream': >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:396: undefined reference >> to `rcu_read_lock_mb' >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:405: undefined reference >> to `rcu_read_unlock_mb' >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:430: undefined reference >> to `rcu_read_lock_mb' >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:457: undefined reference >> to `rcu_read_unlock_mb' >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:475: undefined reference >> to `call_rcu_mb' >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function >> `consumer_thread_data_poll': >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:2266: undefined reference >> to `rcu_register_thread_mb' >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function >> `consumer_update_poll_array': >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:940: undefined reference >> to `rcu_read_lock_mb' >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:961: undefined reference >> to `rcu_read_unlock_mb' >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function >> `destroy_data_stream_ht': >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:1766: undefined reference >> to `rcu_read_lock_mb' >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:1774: undefined reference >> to `rcu_read_unlock_mb' >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function >> `consumer_thread_data_poll': >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:2505: undefined reference >> to `rcu_unregister_thread_mb' >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function >> `consumer_add_stream': >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:586: undefined reference >> to `rcu_read_lock_mb' >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:624: undefined reference >> to `rcu_read_unlock_mb' >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function >> `validate_endpoint_status_data_stream': >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:2015: undefined reference >> to `rcu_read_lock_mb' >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:2024: undefined reference >> to `rcu_read_unlock_mb' >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function >> `consumer_allocate_stream': >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:501: undefined reference >> to `rcu_read_lock_mb' >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:560: undefined reference >> to `rcu_read_unlock_mb' >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:564: undefined reference >> to `rcu_read_unlock_mb' >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function >> `update_endpoint_status_by_netidx': >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:273: undefined reference >> to `rcu_read_lock_mb' >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:290: undefined reference >> to `rcu_read_unlock_mb' >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function >> `lttng_consumer_on_read_subbuffer_splice': >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:1517: undefined reference >> to `rcu_read_lock_mb' >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:1687: undefined reference >> to `rcu_read_unlock_mb' >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function >> `lttng_consumer_on_read_subbuffer_mmap': >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:1345: undefined reference >> to `rcu_read_lock_mb' >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:1478: undefined reference >> to `rcu_read_unlock_mb' >> ../../../src/common/.libs/libconsumer.a(kernel-consumer.o): In function >> `lttng_kconsumer_recv_cmd': >> >> /usr/src/LTTng/lttng-tools/src/common/kernel-consumer/kernel-consumer.c:112: >> undefined reference to `rcu_read_lock_mb' >> >> /usr/src/LTTng/lttng-tools/src/common/kernel-consumer/kernel-consumer.c:352: >> undefined reference to `rcu_read_unlock_mb' >> >> /usr/src/LTTng/lttng-tools/src/common/kernel-consumer/kernel-consumer.c:287: >> undefined reference to `rcu_read_unlock_mb' >> >> /usr/src/LTTng/lttng-tools/src/common/kernel-consumer/kernel-consumer.c:180: >> undefined reference to `rcu_read_unlock_mb' >> >> /usr/src/LTTng/lttng-tools/src/common/kernel-consumer/kernel-consumer.c:172: >> undefined reference to `rcu_read_unlock_mb' >> ../../../src/common/.libs/libconsumer.a(hashtable.o): In function >> `cds_lfht_new': >> /usr/src/LTTng/lttng-tools/src/common/hashtable/rculfhash.h:167: undefined >> reference to `rcu_flavor_mb' >> ../../../src/common/.libs/libconsumer.a(ust-consumer.o): In function >> `lttng_ustconsumer_recv_cmd': >> /usr/src/LTTng/lttng-tools/src/common/ust-consumer/ust-consumer.c:131: >> undefined reference to `rcu_read_lock_mb' >> /usr/src/LTTng/lttng-tools/src/common/ust-consumer/ust-consumer.c:406: >> undefined reference to `rcu_read_unlock_mb' >> /usr/src/LTTng/lttng-tools/src/common/ust-consumer/ust-consumer.c:376: >> undefined reference to `rcu_read_unlock_mb' >> /usr/src/LTTng/lttng-tools/src/common/ust-consumer/ust-consumer.c:232: >> undefined reference to `rcu_read_unlock_mb' >> /usr/src/LTTng/lttng-tools/src/common/ust-consumer/ust-consumer.c:165: >> undefined reference to `rcu_read_unlock_mb' >> /usr/src/LTTng/lttng-tools/src/common/ust-consumer/ust-consumer.c:226: >> undefined reference to `rcu_read_unlock_mb' >> collect2: ld returned 1 exit status >> make[3]: *** [lttng-consumerd] Error 1 >> make[3]: Leaving directory >> `/usr/src/LTTng/lttng-tools/src/bin/lttng-consumerd' >> make[2]: *** [all-recursive] Error 1 >> make[2]: Leaving directory `/usr/src/LTTng/lttng-tools/src/bin' >> make[1]: *** [all-recursive] Error 1 >> make[1]: Leaving directory `/usr/src/LTTng/lttng-tools/src' >> make: *** [all-recursive] Error 1 >> > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > From mathieu.desnoyers at efficios.com Mon Feb 18 13:32:17 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Mon, 18 Feb 2013 13:32:17 -0500 Subject: [lttng-dev] lttng-tools : undefined reference to rcu_read_lock_mb In-Reply-To: References: Message-ID: <20130218183217.GA12451@Krystal> * J?r?mie Galarneau (jeremie.galarneau at efficios.com) wrote: > It appears to be caused by a conflict between what you installed in > /usr/local/lib and /usr/lib. > Please make sure you uninstalled the libs in /usr/local/lib. > > You may do so by running ./configure without any option, which will > set the default install path and then run "make uninstall". FYI extra info about his setup that did not hit the mailing list: "Don't care: solved with LOADFLAGS=-L/use/local/lib/ ./configure Thank you anyway. V. G. Il giorno 18/feb/2013 14:34, "Vanni Genua" ha scritto:" Thanks, Mathieu > > Regards, > J?r?mie > > On Mon, Feb 18, 2013 at 10:49 AM, Vanni Genua wrote: > > After having installed on an Intel x86 platform lttng-modules, > > userspace-rcu, lttng-ust, I tried to install LTTng-tools but I get the > > following error, why? > > > >> 1) > >> lttng-tools # ./bootstrap > >> + '[' '!' -e config ']' > >> + autoreconf -i > >> 2) > >> lttng-tools # ./configure > >> checking build system type... i686-pc-linux-gnu > >> checking host system type... i686-pc-linux-gnu > >> checking target system type... i686-pc-linux-gnu > >> checking for a BSD-compatible install... /usr/bin/install -c > >> checking whether build environment is sane... yes > >> checking for a thread-safe mkdir -p... /bin/mkdir -p > >> checking for gawk... gawk > >> checking whether make sets $(MAKE)... yes > >> checking for grep that handles long lines and -e... /bin/grep > >> checking for occurence(s) of link_all_deplibs = no in > >> ./config/libtool.m4... none > >> checking for style of include used by make... GNU > >> checking for gcc... gcc > >> checking whether the C compiler works... yes > >> checking for C compiler default output file name... a.out > >> checking for suffix of executables... > >> checking whether we are cross compiling... no > >> checking for suffix of object files... o > >> checking whether we are using the GNU C compiler... yes > >> checking whether gcc accepts -g... yes > >> checking for gcc option to accept ISO C89... none needed > >> checking dependency style of gcc... gcc3 > >> checking how to run the C preprocessor... gcc -E > >> checking for egrep... /bin/grep -E > >> checking for ANSI C header files... yes > >> checking for sys/types.h... yes > >> checking for sys/stat.h... yes > >> checking for stdlib.h... yes > >> checking for string.h... yes > >> checking for memory.h... yes > >> checking for strings.h... yes > >> checking for inttypes.h... yes > >> checking for stdint.h... yes > >> checking for unistd.h... yes > >> checking for sys/types.h... (cached) yes > >> checking for unistd.h... (cached) yes > >> checking fcntl.h usability... yes > >> checking fcntl.h presence... yes > >> checking for fcntl.h... yes > >> checking for string.h... (cached) yes > >> checking pthread.h usability... yes > >> checking pthread.h presence... yes > >> checking for pthread.h... yes > >> checking limits.h usability... yes > >> checking limits.h presence... yes > >> checking for limits.h... yes > >> checking signal.h usability... yes > >> checking signal.h presence... yes > >> checking for signal.h... yes > >> checking for stdlib.h... (cached) yes > >> checking sys/un.h usability... yes > >> checking sys/un.h presence... yes > >> checking for sys/un.h... yes > >> checking sys/socket.h usability... yes > >> checking sys/socket.h presence... yes > >> checking for sys/socket.h... yes > >> checking for stdlib.h... (cached) yes > >> checking stdio.h usability... yes > >> checking stdio.h presence... yes > >> checking for stdio.h... yes > >> checking getopt.h usability... yes > >> checking getopt.h presence... yes > >> checking for getopt.h... yes > >> checking sys/ipc.h usability... yes > >> checking sys/ipc.h presence... yes > >> checking for sys/ipc.h... yes > >> checking sys/shm.h usability... yes > >> checking sys/shm.h presence... yes > >> checking for sys/shm.h... yes > >> checking popt.h usability... yes > >> checking popt.h presence... yes > >> checking for popt.h... yes > >> checking grp.h usability... yes > >> checking grp.h presence... yes > >> checking for grp.h... yes > >> checking for pthread_create in -lpthread... yes > >> checking for poptGetContext in -lpopt... yes > >> checking whether cds_list_add is declared... yes > >> checking whether cds_wfq_init is declared... yes > >> checking whether cds_wfq_dequeue_blocking is declared... yes > >> checking whether futex_async is declared... yes > >> checking whether rcu_thread_offline is declared... yes > >> checking whether rcu_thread_online is declared... yes > >> checking whether caa_likely is declared... yes > >> checking for ustctl_set_filter in -llttng-ust-ctl... yes > >> checking for sched_getcpu... yes > >> checking for sysconf... yes > >> checking for sync_file_range... yes > >> checking for dlopen in -ldl... yes > >> checking for fmemopen in -lc... yes > >> checking for open_memstream in -lc... yes > >> configure: You may configure with --enable-python-bindings if you want > >> Python bindings. > >> checking linux/version.h usability... yes > >> checking linux/version.h presence... yes > >> checking for linux/version.h... yes > >> checking for Linux epoll(7) interface... yes > >> checking for special C compiler options needed for large files... no > >> checking for _FILE_OFFSET_BITS value needed for large files... 64 > >> checking for gcc... (cached) gcc > >> checking whether we are using the GNU C compiler... (cached) yes > >> checking whether gcc accepts -g... (cached) yes > >> checking for gcc option to accept ISO C89... (cached) none needed > >> checking dependency style of gcc... (cached) gcc3 > >> checking how to print strings... printf > >> checking for a sed that does not truncate output... /bin/sed > >> checking for fgrep... /bin/grep -F > >> checking for ld used by gcc... /usr/i686-pc-linux-gnu/bin/ld > >> checking if the linker (/usr/i686-pc-linux-gnu/bin/ld) is GNU ld... yes > >> checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B > >> checking the name lister (/usr/bin/nm -B) interface... BSD nm > >> checking whether ln -s works... yes > >> checking the maximum length of command line arguments... 1572864 > >> checking whether the shell understands some XSI constructs... yes > >> checking whether the shell understands "+="... yes > >> checking for /usr/i686-pc-linux-gnu/bin/ld option to reload object > >> files... -r > >> checking for objdump... objdump > >> checking how to recognize dependent libraries... pass_all > >> checking for ar... ar > >> checking for strip... strip > >> checking for ranlib... ranlib > >> checking command to parse /usr/bin/nm -B output from gcc object... ok > >> checking for dlfcn.h... yes > >> checking for objdir... .libs > >> checking if gcc supports -fno-rtti -fno-exceptions... no > >> checking for gcc option to produce PIC... -fPIC -DPIC > >> checking if gcc PIC flag -fPIC -DPIC works... yes > >> checking if gcc static flag -static works... yes > >> checking if gcc supports -c -o file.o... yes > >> checking if gcc supports -c -o file.o... (cached) yes > >> checking whether the gcc linker (/usr/i686-pc-linux-gnu/bin/ld) supports > >> shared libraries... yes > >> checking whether -lc should be explicitly linked in... no > >> checking dynamic linker characteristics... GNU/Linux ld.so > >> checking how to hardcode library paths into programs... immediate > >> checking whether stripping libraries is possible... yes > >> checking if libtool supports shared libraries... yes > >> checking whether to build shared libraries... yes > >> checking whether to build static libraries... yes > >> checking for bison... bison -y > >> checking for flex... flex > >> checking lex output file root... lex.yy > >> checking lex library... -lfl > >> checking whether yytext is a pointer... yes > >> configure: creating ./config.status > >> config.status: creating Makefile > >> config.status: creating doc/Makefile > >> config.status: creating doc/man/Makefile > >> config.status: creating include/Makefile > >> config.status: creating extras/Makefile > >> config.status: creating extras/bindings/Makefile > >> config.status: creating extras/bindings/swig/Makefile > >> config.status: creating extras/bindings/swig/python/Makefile > >> config.status: creating src/Makefile > >> config.status: creating src/common/Makefile > >> config.status: creating src/common/kernel-ctl/Makefile > >> config.status: creating src/common/kernel-consumer/Makefile > >> config.status: creating src/common/ust-consumer/Makefile > >> config.status: creating src/common/hashtable/Makefile > >> config.status: creating src/common/sessiond-comm/Makefile > >> config.status: creating src/common/compat/Makefile > >> config.status: creating src/common/relayd/Makefile > >> config.status: creating src/common/testpoint/Makefile > >> config.status: creating src/lib/Makefile > >> config.status: creating src/lib/lttng-ctl/Makefile > >> config.status: creating src/lib/lttng-ctl/filter/Makefile > >> config.status: creating src/lib/lttng-ctl/lttng-ctl.pc > >> config.status: creating src/bin/Makefile > >> config.status: creating src/bin/lttng-consumerd/Makefile > >> config.status: creating src/bin/lttng-sessiond/Makefile > >> config.status: creating src/bin/lttng-relayd/Makefile > >> config.status: creating src/bin/lttng/Makefile > >> config.status: creating tests/Makefile > >> config.status: creating tests/kernel/Makefile > >> config.status: creating tests/tools/Makefile > >> config.status: creating tests/tools/streaming/Makefile > >> config.status: creating tests/tools/filtering/Makefile > >> config.status: creating tests/tools/health/Makefile > >> config.status: creating tests/ust/Makefile > >> config.status: creating tests/ust/nprocesses/Makefile > >> config.status: creating tests/ust/high-throughput/Makefile > >> config.status: creating tests/ust/low-throughput/Makefile > >> config.status: creating tests/ust/before-after/Makefile > >> config.status: creating tests/ust/multi-session/Makefile > >> config.status: creating tests/ust/overlap/Makefile > >> config.status: creating tests/ust/overlap/demo/Makefile > >> config.status: creating include/config.h > >> config.status: include/config.h is unchanged > >> config.status: executing depfiles commands > >> config.status: executing libtool commands > >> > >> Version name: Basse Messe > >> Light coloured German ale whose style was named after the city Cologne > >> (Koln) where it was first brewed. It is a rather simple beer with lightly > >> fruity aromas and a delicate hoppy fragrance. The beer has a pronounced > >> malty taste with a subtle bitter aftertaste > >> > >> Target architecture: i686 > >> Lttng-UST support: Enabled > >> Python binding: Disabled > >> All binaries will be built. > >> > >> Binaries will be installed in: /usr/local/bin > >> Libraries will be installed in: /usr/local/lib > >> > >> The sessiond daemon will look in the following directories: > >> 32-bit consumerd executable at: > >> /usr/local/lib/lttng/libexec/lttng-consumerd > >> 32-bit consumer libraries in: /usr/local/lib > >> 64-bit consumerd executable at: > >> /usr/local/lib/lttng/libexec/lttng-consumerd > >> 64-bit consumer libraries in: /usr/local/lib > >> > >> 3) lttng-tools # make > >> Making all in src > >> make[1]: Entering directory `/usr/src/LTTng/lttng-tools/src' > >> Making all in common > >> make[2]: Entering directory `/usr/src/LTTng/lttng-tools/src/common' > >> Making all in compat > >> make[3]: Entering directory `/usr/src/LTTng/lttng-tools/src/common/compat' > >> CC compat-fcntl.lo > >> CC compat-epoll.lo > >> CCLD libcompat.la > >> make[3]: Leaving directory `/usr/src/LTTng/lttng-tools/src/common/compat' > >> Making all in hashtable > >> make[3]: Entering directory > >> `/usr/src/LTTng/lttng-tools/src/common/hashtable' > >> CC hashtable.lo > >> CC utils.lo > >> CC rculfhash.lo > >> CC rculfhash-mm-chunk.lo > >> CC rculfhash-mm-mmap.lo > >> CC rculfhash-mm-order.lo > >> CCLD libhashtable.la > >> make[3]: Leaving directory > >> `/usr/src/LTTng/lttng-tools/src/common/hashtable' > >> Making all in kernel-ctl > >> make[3]: Entering directory > >> `/usr/src/LTTng/lttng-tools/src/common/kernel-ctl' > >> CC kernel-ctl.lo > >> CCLD libkernel-ctl.la > >> make[3]: Leaving directory > >> `/usr/src/LTTng/lttng-tools/src/common/kernel-ctl' > >> Making all in sessiond-comm > >> make[3]: Entering directory > >> `/usr/src/LTTng/lttng-tools/src/common/sessiond-comm' > >> CC sessiond-comm.lo > >> CC unix.lo > >> CC inet.lo > >> CC inet6.lo > >> CCLD libsessiond-comm.la > >> make[3]: Leaving directory > >> `/usr/src/LTTng/lttng-tools/src/common/sessiond-comm' > >> Making all in relayd > >> make[3]: Entering directory `/usr/src/LTTng/lttng-tools/src/common/relayd' > >> CC relayd.lo > >> relayd.c: In function 'recv_reply': > >> relayd.c:90: warning: format '%ld' expects type 'long int', but argument 3 > >> has type 'size_t' > >> relayd.c:90: warning: format '%ld' expects type 'long int', but argument 3 > >> has type 'size_t' > >> relayd.c:90: warning: format '%ld' expects type 'long int', but argument 3 > >> has type 'size_t' > >> relayd.c:90: warning: format '%ld' expects type 'long int', but argument 3 > >> has type 'size_t' > >> relayd.c:98: warning: format '%lu' expects type 'long unsigned int', but > >> argument 4 has type 'size_t' > >> relayd.c:98: warning: format '%lu' expects type 'long unsigned int', but > >> argument 4 has type 'size_t' > >> relayd.c:98: warning: format '%lu' expects type 'long unsigned int', but > >> argument 4 has type 'size_t' > >> relayd.c:98: warning: format '%lu' expects type 'long unsigned int', but > >> argument 4 has type 'size_t' > >> relayd.c: In function 'relayd_send_data_hdr': > >> relayd.c:353: warning: format '%ld' expects type 'long int', but argument > >> 3 has type 'size_t' > >> relayd.c:353: warning: format '%ld' expects type 'long int', but argument > >> 3 has type 'size_t' > >> relayd.c:353: warning: format '%ld' expects type 'long int', but argument > >> 3 has type 'size_t' > >> relayd.c:353: warning: format '%ld' expects type 'long int', but argument > >> 3 has type 'size_t' > >> CCLD librelayd.la > >> make[3]: Leaving directory `/usr/src/LTTng/lttng-tools/src/common/relayd' > >> Making all in kernel-consumer > >> make[3]: Entering directory > >> `/usr/src/LTTng/lttng-tools/src/common/kernel-consumer' > >> CC kernel-consumer.lo > >> CCLD libkernel-consumer.la > >> make[3]: Leaving directory > >> `/usr/src/LTTng/lttng-tools/src/common/kernel-consumer' > >> Making all in ust-consumer > >> make[3]: Entering directory > >> `/usr/src/LTTng/lttng-tools/src/common/ust-consumer' > >> CC ust-consumer.lo > >> ust-consumer.c: In function 'lttng_ustconsumer_read_subbuffer': > >> ust-consumer.c:562: warning: format '%zd' expects type 'signed size_t', > >> but argument 3 has type 'long int' > >> ust-consumer.c:562: warning: format '%zd' expects type 'signed size_t', > >> but argument 3 has type 'long int' > >> ust-consumer.c:562: warning: format '%zd' expects type 'signed size_t', > >> but argument 3 has type 'long int' > >> ust-consumer.c:562: warning: format '%zd' expects type 'signed size_t', > >> but argument 3 has type 'long int' > >> CCLD libust-consumer.la > >> make[3]: Leaving directory > >> `/usr/src/LTTng/lttng-tools/src/common/ust-consumer' > >> Making all in testpoint > >> make[3]: Entering directory > >> `/usr/src/LTTng/lttng-tools/src/common/testpoint' > >> CC testpoint.lo > >> CCLD libtestpoint.la > >> make[3]: Leaving directory > >> `/usr/src/LTTng/lttng-tools/src/common/testpoint' > >> make[3]: Entering directory `/usr/src/LTTng/lttng-tools/src/common' > >> CC error.lo > >> CC utils.lo > >> CC runas.lo > >> CC futex.lo > >> CC uri.lo > >> CC defaults.lo > >> CCLD libcommon.la > >> CC consumer.lo > >> consumer.c: In function 'consumer_add_relayd_socket': > >> consumer.c:2707: warning: 'relayd' may be used uninitialized in this > >> function > >> CCLD libconsumer.la > >> copying selected object files to avoid basename conflicts... > >> make[3]: Leaving directory `/usr/src/LTTng/lttng-tools/src/common' > >> make[2]: Leaving directory `/usr/src/LTTng/lttng-tools/src/common' > >> Making all in lib > >> make[2]: Entering directory `/usr/src/LTTng/lttng-tools/src/lib' > >> Making all in lttng-ctl > >> make[3]: Entering directory `/usr/src/LTTng/lttng-tools/src/lib/lttng-ctl' > >> Making all in filter > >> make[4]: Entering directory > >> `/usr/src/LTTng/lttng-tools/src/lib/lttng-ctl/filter' > >> YACC filter-parser.c > >> updating filter-parser.h > >> updating filter-parser.output > >> make all-am > >> make[5]: Entering directory > >> `/usr/src/LTTng/lttng-tools/src/lib/lttng-ctl/filter' > >> LEX filter-lexer.c > >> CC libfilter_la-filter-lexer.lo > >> filter-lexer.c: In function 'yylex': > >> filter-lexer.l:136: warning: ignoring return value of 'fwrite', declared > >> with attribute warn_unused_result > >> CC libfilter_la-filter-parser.lo > >> CC libfilter_la-filter-visitor-set-parent.lo > >> CC libfilter_la-filter-visitor-xml.lo > >> CC libfilter_la-filter-visitor-generate-ir.lo > >> CC libfilter_la-filter-visitor-ir-check-binary-op-nesting.lo > >> CC libfilter_la-filter-visitor-generate-bytecode.lo > >> CCLD libfilter.la > >> CC filter-grammar-test.o > >> CCLD filter-grammar-test > >> make[5]: Leaving directory > >> `/usr/src/LTTng/lttng-tools/src/lib/lttng-ctl/filter' > >> make[4]: Leaving directory > >> `/usr/src/LTTng/lttng-tools/src/lib/lttng-ctl/filter' > >> make[4]: Entering directory `/usr/src/LTTng/lttng-tools/src/lib/lttng-ctl' > >> CC lttng-ctl.lo > >> CCLD liblttng-ctl.la > >> copying selected object files to avoid basename conflicts... > >> make[4]: Leaving directory `/usr/src/LTTng/lttng-tools/src/lib/lttng-ctl' > >> make[3]: Leaving directory `/usr/src/LTTng/lttng-tools/src/lib/lttng-ctl' > >> make[3]: Entering directory `/usr/src/LTTng/lttng-tools/src/lib' > >> make[3]: Nothing to be done for `all-am'. > >> make[3]: Leaving directory `/usr/src/LTTng/lttng-tools/src/lib' > >> make[2]: Leaving directory `/usr/src/LTTng/lttng-tools/src/lib' > >> Making all in bin > >> make[2]: Entering directory `/usr/src/LTTng/lttng-tools/src/bin' > >> Making all in lttng-consumerd > >> make[3]: Entering directory > >> `/usr/src/LTTng/lttng-tools/src/bin/lttng-consumerd' > >> CC lttng-consumerd.o > >> CCLD lttng-consumerd > >> /usr/lib/gcc/i686-pc-linux-gnu/4.4.4/../../../../i686-pc-linux-gnu/bin/ld: > >> warning: liburcu-common.so.1, needed by /usr/local/lib/liblttng-ust-ctl.so, > >> may conflict with liburcu-common.so.2 > >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function > >> `consumer_data_pending': > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:2921: undefined reference > >> to `rcu_read_lock_mb' > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:3030: undefined reference > >> to `rcu_read_unlock_mb' > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:3024: undefined reference > >> to `rcu_read_unlock_mb' > >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function > >> `consumer_steal_stream_key': > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:116: undefined reference > >> to `rcu_read_lock_mb' > >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function > >> `consumer_find_stream': > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:99: undefined reference > >> to `rcu_read_lock_mb' > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:107: undefined reference > >> to `rcu_read_unlock_mb' > >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function > >> `consumer_steal_stream_key': > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:127: undefined reference > >> to `rcu_read_unlock_mb' > >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function > >> `consumer_find_stream': > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:107: undefined reference > >> to `rcu_read_unlock_mb' > >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function > >> `consumer_steal_channel_key': > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:161: undefined reference > >> to `rcu_read_lock_mb' > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:172: undefined reference > >> to `rcu_read_unlock_mb' > >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function > >> `consumer_add_channel': > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:905: undefined reference > >> to `rcu_read_lock_mb' > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:918: undefined reference > >> to `rcu_read_unlock_mb' > >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function > >> `destroy_relayd': > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:234: undefined reference > >> to `call_rcu_mb' > >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function > >> `consumer_thread_sessiond_poll': > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:2523: undefined reference > >> to `rcu_register_thread_mb' > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:2639: undefined reference > >> to `rcu_unregister_thread_mb' > >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function > >> `consumer_del_channel': > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:814: undefined reference > >> to `rcu_read_lock_mb' > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:818: undefined reference > >> to `rcu_read_unlock_mb' > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:839: undefined reference > >> to `call_rcu_mb' > >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function > >> `consumer_del_metadata_stream': > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:1853: undefined reference > >> to `rcu_read_lock_mb' > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:1862: undefined reference > >> to `rcu_read_unlock_mb' > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:1886: undefined reference > >> to `rcu_read_lock_mb' > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:1912: undefined reference > >> to `rcu_read_unlock_mb' > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:1931: undefined reference > >> to `call_rcu_mb' > >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function > >> `consumer_thread_metadata_poll': > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:2073: undefined reference > >> to `rcu_register_thread_mb' > >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function > >> `destroy_stream_ht': > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:1793: undefined reference > >> to `rcu_read_lock_mb' > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:1801: undefined reference > >> to `rcu_read_unlock_mb' > >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function > >> `consumer_thread_metadata_poll': > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:2247: undefined reference > >> to `rcu_unregister_thread_mb' > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:2183: undefined reference > >> to `rcu_read_lock_mb' > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:2236: undefined reference > >> to `rcu_read_unlock_mb' > >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function > >> `consumer_add_metadata_stream': > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:1959: undefined reference > >> to `rcu_read_lock_mb' > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:1998: undefined reference > >> to `rcu_read_unlock_mb' > >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function > >> `validate_endpoint_status_metadata_stream': > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:2040: undefined reference > >> to `rcu_read_lock_mb' > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:2055: undefined reference > >> to `rcu_read_unlock_mb' > >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function > >> `lttng_consumer_cleanup': > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:1044: undefined reference > >> to `rcu_read_lock_mb' > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:1053: undefined reference > >> to `rcu_read_unlock_mb' > >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function > >> `cleanup_relayd_ht': > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:246: undefined reference > >> to `rcu_read_lock_mb' > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:255: undefined reference > >> to `rcu_read_unlock_mb' > >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function > >> `consumer_del_stream': > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:396: undefined reference > >> to `rcu_read_lock_mb' > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:405: undefined reference > >> to `rcu_read_unlock_mb' > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:430: undefined reference > >> to `rcu_read_lock_mb' > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:457: undefined reference > >> to `rcu_read_unlock_mb' > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:475: undefined reference > >> to `call_rcu_mb' > >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function > >> `consumer_thread_data_poll': > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:2266: undefined reference > >> to `rcu_register_thread_mb' > >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function > >> `consumer_update_poll_array': > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:940: undefined reference > >> to `rcu_read_lock_mb' > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:961: undefined reference > >> to `rcu_read_unlock_mb' > >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function > >> `destroy_data_stream_ht': > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:1766: undefined reference > >> to `rcu_read_lock_mb' > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:1774: undefined reference > >> to `rcu_read_unlock_mb' > >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function > >> `consumer_thread_data_poll': > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:2505: undefined reference > >> to `rcu_unregister_thread_mb' > >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function > >> `consumer_add_stream': > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:586: undefined reference > >> to `rcu_read_lock_mb' > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:624: undefined reference > >> to `rcu_read_unlock_mb' > >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function > >> `validate_endpoint_status_data_stream': > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:2015: undefined reference > >> to `rcu_read_lock_mb' > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:2024: undefined reference > >> to `rcu_read_unlock_mb' > >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function > >> `consumer_allocate_stream': > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:501: undefined reference > >> to `rcu_read_lock_mb' > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:560: undefined reference > >> to `rcu_read_unlock_mb' > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:564: undefined reference > >> to `rcu_read_unlock_mb' > >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function > >> `update_endpoint_status_by_netidx': > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:273: undefined reference > >> to `rcu_read_lock_mb' > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:290: undefined reference > >> to `rcu_read_unlock_mb' > >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function > >> `lttng_consumer_on_read_subbuffer_splice': > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:1517: undefined reference > >> to `rcu_read_lock_mb' > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:1687: undefined reference > >> to `rcu_read_unlock_mb' > >> ../../../src/common/.libs/libconsumer.a(consumer.o): In function > >> `lttng_consumer_on_read_subbuffer_mmap': > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:1345: undefined reference > >> to `rcu_read_lock_mb' > >> /usr/src/LTTng/lttng-tools/src/common/consumer.c:1478: undefined reference > >> to `rcu_read_unlock_mb' > >> ../../../src/common/.libs/libconsumer.a(kernel-consumer.o): In function > >> `lttng_kconsumer_recv_cmd': > >> > >> /usr/src/LTTng/lttng-tools/src/common/kernel-consumer/kernel-consumer.c:112: > >> undefined reference to `rcu_read_lock_mb' > >> > >> /usr/src/LTTng/lttng-tools/src/common/kernel-consumer/kernel-consumer.c:352: > >> undefined reference to `rcu_read_unlock_mb' > >> > >> /usr/src/LTTng/lttng-tools/src/common/kernel-consumer/kernel-consumer.c:287: > >> undefined reference to `rcu_read_unlock_mb' > >> > >> /usr/src/LTTng/lttng-tools/src/common/kernel-consumer/kernel-consumer.c:180: > >> undefined reference to `rcu_read_unlock_mb' > >> > >> /usr/src/LTTng/lttng-tools/src/common/kernel-consumer/kernel-consumer.c:172: > >> undefined reference to `rcu_read_unlock_mb' > >> ../../../src/common/.libs/libconsumer.a(hashtable.o): In function > >> `cds_lfht_new': > >> /usr/src/LTTng/lttng-tools/src/common/hashtable/rculfhash.h:167: undefined > >> reference to `rcu_flavor_mb' > >> ../../../src/common/.libs/libconsumer.a(ust-consumer.o): In function > >> `lttng_ustconsumer_recv_cmd': > >> /usr/src/LTTng/lttng-tools/src/common/ust-consumer/ust-consumer.c:131: > >> undefined reference to `rcu_read_lock_mb' > >> /usr/src/LTTng/lttng-tools/src/common/ust-consumer/ust-consumer.c:406: > >> undefined reference to `rcu_read_unlock_mb' > >> /usr/src/LTTng/lttng-tools/src/common/ust-consumer/ust-consumer.c:376: > >> undefined reference to `rcu_read_unlock_mb' > >> /usr/src/LTTng/lttng-tools/src/common/ust-consumer/ust-consumer.c:232: > >> undefined reference to `rcu_read_unlock_mb' > >> /usr/src/LTTng/lttng-tools/src/common/ust-consumer/ust-consumer.c:165: > >> undefined reference to `rcu_read_unlock_mb' > >> /usr/src/LTTng/lttng-tools/src/common/ust-consumer/ust-consumer.c:226: > >> undefined reference to `rcu_read_unlock_mb' > >> collect2: ld returned 1 exit status > >> make[3]: *** [lttng-consumerd] Error 1 > >> make[3]: Leaving directory > >> `/usr/src/LTTng/lttng-tools/src/bin/lttng-consumerd' > >> make[2]: *** [all-recursive] Error 1 > >> make[2]: Leaving directory `/usr/src/LTTng/lttng-tools/src/bin' > >> make[1]: *** [all-recursive] Error 1 > >> make[1]: Leaving directory `/usr/src/LTTng/lttng-tools/src' > >> make: *** [all-recursive] Error 1 > >> > > > > > > _______________________________________________ > > lttng-dev mailing list > > lttng-dev at lists.lttng.org > > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From suchakrapani.sharma at polymtl.ca Mon Feb 18 16:58:34 2013 From: suchakrapani.sharma at polymtl.ca (Suchakrapani Datt Sharma) Date: Mon, 18 Feb 2013 16:58:34 -0500 Subject: [lttng-dev] Benefits of script driven tracing Message-ID: <1361224714.5122a40ad308b@www.imp.polymtl.ca> I have started my tracing journey with LTTng :) I was going through old stuff on the list related to [1] and the discussion that followed. Is there any visible benefits that script driven tracing can yield us? I know that in [2] indication on "running scripts on information extracted from UST buffers" had been given. Has something like this been tried out before? [1] http://lists.lttng.org/pipermail/lttng-dev/2011-February/015200.html [2] http://lists.lttng.org/pipermail/lttng-dev/2011-February/015212.html Cheers, Suchakra From michel.dagenais at polymtl.ca Tue Feb 19 08:23:16 2013 From: michel.dagenais at polymtl.ca (Michel Dagenais) Date: Tue, 19 Feb 2013 08:23:16 -0500 (EST) Subject: [lttng-dev] Benefits of script driven tracing In-Reply-To: <1361224714.5122a40ad308b@www.imp.polymtl.ca> Message-ID: <153054748.299921361280196654.JavaMail.root@srv12.zimbra.polymtl.ca> ----- "Suchakrapani Datt Sharma" wrote: > I have started my tracing journey with LTTng :) I was going through > old stuff on the list related to [1] and the discussion that followed. > Is there any visible benefits that script driven tracing can yield us? Tom Zanussi has worked for some time on connecting traces to python and perl scripts. This can be pretty handy for ad hoc analysis. http://www.kernelhub.org/?msg=198439&p=2 From vivekkumar.p at gmail.com Wed Feb 20 00:04:07 2013 From: vivekkumar.p at gmail.com (Vivek Kumar) Date: Wed, 20 Feb 2013 10:34:07 +0530 Subject: [lttng-dev] Issue faced in logging the traces In-Reply-To: References: <511E463F.2080605@efficios.com> Message-ID: Hi David, Any update? Please let me know if more info is required. Regards, Vivek On Mon, Feb 18, 2013 at 4:26 PM, Vivek Kumar wrote: > Hi David, > > Thanks for the response. LTTng-ust is also ported. > Please find attached the PPT where I have taken the snaps and described > the issue faced. > At present I am trying to port and instrument LTTng for userspace only. > > My SoC is ARM-Cortex A9 from Mindspeed and the os is openWRT Linux. > > LTTng doesn't report any issue when I run it to instrument in userspace > but CTF is not logged in the Home directory, please take a look to the > powerpoint slides for descriptions and commands that I give. > > Regards, Vivek > > > > On Fri, Feb 15, 2013 at 7:59 PM, David Goulet wrote: > >> Hi Vivek, >> >> In order to collect a trace you need to instrument your application with >> LTTng-UST tracepoints. >> >> If you like to gather the syscalls for instance, you need to install the >> LTTng modules and start your session daemon as root. >> >> If you are still experiencing problem, please provide the commands you >> use and setup. >> >> Thanks! >> David >> >> Vivek Kumar: >> > Hi, >> > >> > I am trying to port LTTng to my arm based board. >> > For userspace tracing, I have been able to successfully port followings: >> > LTTng-tools, >> > LTT-ust Library >> > Userspace-rcu >> > libpopt >> > >> > Now I can see that lttng-sessiond is running, and am able to create >> > sessions, enable-event and start and stop tracing. >> > But, I don't see traces be logged in the home directory (indeed nothing >> > happens, i.e, not even the creation of the base directory -> >> lttng-traces). >> > Am I missing anything because of that LTTng is failing to log traces? >> > Please help. >> > >> > Regards, Vivek >> > >> > >> > -- >> > Best, Vivek >> > >> > >> > This body part will be downloaded on demand. >> > > > > -- > Best, Vivek -- Best, Vivek -------------- next part -------------- An HTML attachment was scrubbed... URL: From sunyin51 at gmail.com Wed Feb 20 01:10:44 2013 From: sunyin51 at gmail.com (yin sun) Date: Tue, 19 Feb 2013 22:10:44 -0800 Subject: [lttng-dev] cases that kernel module uses lttng to trace its own code Message-ID: Hello, Is there any example that a loadable kernel module utilize lttng tracepoint to trace its own code. Not those ready made probes. In this case, what minimal lttng modules do I have to load? Thanks, /Yin From Daniel.Thibault at drdc-rddc.gc.ca Wed Feb 20 16:15:06 2013 From: Daniel.Thibault at drdc-rddc.gc.ca (Thibault, Daniel) Date: Wed, 20 Feb 2013 21:15:06 +0000 Subject: [lttng-dev] Function of lttng create --disable-consumer? Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD01C538@VAL-E-01.valcartier.drdc-rddc.gc.ca> Back on Wed Oct 3 14:27:07 EDT 2012, David Goulet wrote, in response to Bernd Hufmann: > > * I'm not sure what is the purpose of the options --no-consumer or > > --disable-consumer. Could you please explain the use cases for using > > --no-consumer or --disable-consumer? > > This basically disables the consumer for a tracing session. It's not very > useful for now but for upcoming snapshots and live tracing, it will make > way more sense! :). In the create.c command code, the --disable-consumer option is checked in only one place, and serves to call disable_consumer after the -C/-D option pair has called enable_consumer to commit its configuration. However, experimentation reveals something odd: $ sudo -H lttng create sessiona By itself, this does not launch the consumer daemon (I'm keeping an eye on the System Monitor window's list of processes, where lttng-consumerd normally appears). Once I later do: $ sudo -H lttng enable-event sched_switch -k The consumer launches at that point. There is no option in enable-event to prevent this. If I instead do: $ sudo -H lttng create sessiona --disable-consumer $ sudo -H lttng enable-event sched_switch -k Precisely the same thing happens. Likewise for 'lttng create sessiona -U net://131.131.131.131' with or without the --disable-consumer switch. But if I instead do: $ sudo -H lttng create sessiona --disable-consumer -C net://131.131.131.131 -D net://131.131.131.131 $ sudo -H lttng enable-event sched_switch -k (Where the net: target has lttng-relayd running) The consumer does *not* launch. Not even after I do: $ sudo -H lttng enable-consumer Starting the trace does not launch the consumer either and, not surprisingly, the trace does not get written anywhere. And all this without any error or warning messages. 'lttng list' looks normal, too. Is this a bug or am I missing something? Daniel U. Thibault R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) / Defence R&D Canada - Valcartier (DRDC Valcartier) Cyber s?curit? pour les missions essentielles (CME) / Mission Critical Cyber Security (MCCS) Protection des syst?mes et contremesures (PSC) / Systems Protection & Countermeasures (SPC) 2459 route de la Bravoure Qu?bec, QC G3J 1X5 CANADA Vox : (418) 844-4000 x4245 Fax : (418) 844-4538 NAC : 918V QSDJ Gouvernement du Canada / Government of Canada From amit.balboul at shinesec.com Thu Feb 21 05:13:29 2013 From: amit.balboul at shinesec.com (Amit Balboul) Date: Thu, 21 Feb 2013 12:13:29 +0200 Subject: [lttng-dev] compiling LTTng for android Message-ID: Hi all, In continue to posts from http://www.mail-archive.com/lttng-dev at lists.lttng.org/msg02542.html, I'm trying to build the LTTng kernel-tracer for Android on ARM: (JB4.2.1 - kernel 3.0.31 - on Galaxy Nexus). I'm having some trouble completing the process, didn't find any usable information so far, maybe u can help. I want to build the: (I've managed in the past to build the modules for goldfish's 2.6.29 but this required patching the kernel). (1) userspace-rcu (2) modules (3) tools I'm currently stuck in the first phase (building userspace-rcu). My steps and the issues I've encountered are: 1. Clone the userspace-rcu git repository 2. Generate a sysroot for arm-linux-androideabi from google's NDK (using its "make-standalone-toolchain.sh" script with arm-linux-androideabi-4.4.3 toolchain). 3. Run ./bootstrap - creating config.h.in, Makefile.in, configure, ... 4. Run ./configure with --host=arm-linux-androideabi and the relevant environment variables (CC, LD, CPPFLAGS, CFLAGS, LDFLAGS, LIB), pointing to the NDK ARM SYSROOT. 5. Run make Some errors I encoutered and their fixes (workarounds), while trying as much as I can leave the sources untouched: 1. syscall.h not found. In some files, the is included. In NDK SYSROOT the syscall.h lays in sys/ FIX: created a link: SYSROOT/include/syscall.h -> SYSROOT/include/sys/syscall.h 2. Android's libraries includes the pthread lib automatically, thus not having a stand-alone pthread library. FIX: removed "-lpthread" from Makefile.am, tests/Makefile.am 3. static declaration of "gettid" follows non-static declaration (in SYSROOT/include/unistd.h, "gettid" is declared as "external") For the mean time I commented this declaration... Maybe adding "#ifndef gettid" before the declaration of "static gettid" in the sources will fix it ? 4. rand_r not declared - added a module that implements rand_r (as seen in https://github.com/xbmc/xbmc/tree/master/xbmc/android/bionic_supplement) 5. undefined reference to rpl_malloc FIX: setting ac_cv_func_malloc_0_nonnull=yes before launching ./configure. now, after running ./configure and make, still not completed. I get many "undefined reference to __sync_syncronize" messages. the urcu/arch/generic.h defines the memory barriers functions as cmm_* but their implementation is not taken from urcu/arch/arm.h but from Line 46 in the same file (generic.h). Can u help with this? Am I missing something here ? Also, how does the build system use the kernel 3.0.31 (or any other) sysroot ? Thank you Amit. -------------- next part -------------- An HTML attachment was scrubbed... URL: From pierre-luc.st-charles at polymtl.ca Thu Feb 21 08:18:50 2013 From: pierre-luc.st-charles at polymtl.ca (Pierre-Luc St-Charles) Date: Thu, 21 Feb 2013 08:18:50 -0500 Subject: [lttng-dev] compiling LTTng for android In-Reply-To: References: Message-ID: Forwarded to mailing list: Hey Amil, Sorry we kept you out of the loop, we've been struggling on some issues in the later projects; as for liburcu, we've come across the same problems you cited, except the last one: - syscall.h / lpthread / gettid : your solutions, or a #ifdef __ANDROID__ barrier, seems to work as a temp fix. - rand_r : after substituting for the regular (not-thread-safe) rand, we decide to go with our own implementation, but the one you found might actually be better - rpl_malloc : same fix here, but we also found that ac_cv_func_realloc_0_nonnull *might* also help in some cases (along with ac_cv_func_malloc_0_nonnull) As for the __sync_synchronize error, we haven't encountered those and we managed to successfully build the library. Possible differences: We opted for AOSP's own pre-built & packaged NDK toolchain, (which can be found here: http://developer.android.com/tools/sdk/ndk/index.html) and pointed the sysroot variable to its platforms/android-14/arch-arm/ directory (latest). By default, it doesn't include some module/kernel headers, but it should be enough for liburcu. We are currently considering adding the liburcu project itself (along with the others) directly in the android external modules, so that it may be compiled with exactly the SAME settings as the rest of the libraries/binaries/modules, using the same NDK (but for that, we'll need to drop the autoconf/automake stuff, and that's another story). The rest should be identical, we might have used some extra parameters here and there that might be based on our environment in the build process, but here they are anyway: in ./configure, add : --target=arm-linux-androideabi --prefix=$SYSROOT/usr make sure you provide $SYSROOT/usr/lib instead of $SYSROOT/lib as the default library path Keep us informed if the problem still happens, we'll try to debug your issue further. On Thu, Feb 21, 2013 at 5:13 AM, Amit Balboul wrote: > Hi all, > > In continue to posts from > http://www.mail-archive.com/lttng-dev at lists.lttng.org/msg02542.html, > > I'm trying to build the LTTng kernel-tracer for Android on ARM: > (JB4.2.1 - kernel 3.0.31 - on Galaxy Nexus). > I'm having some trouble completing the process, didn't find any usable > information so far, maybe u can help. > > I want to build the: (I've managed in the past to build the modules for > goldfish's 2.6.29 but this required patching the kernel). > (1) userspace-rcu > (2) modules > (3) tools > I'm currently stuck in the first phase (building userspace-rcu). > > My steps and the issues I've encountered are: > 1. Clone the userspace-rcu git repository > 2. Generate a sysroot for arm-linux-androideabi from google's NDK (using > its "make-standalone-toolchain.sh" script with arm-linux-androideabi-4.4.3 > toolchain). > 3. Run ./bootstrap - creating config.h.in, Makefile.in, configure, ... > 4. Run ./configure with --host=arm-linux-androideabi and the relevant > environment variables (CC, LD, CPPFLAGS, CFLAGS, LDFLAGS, LIB), pointing to > the NDK ARM SYSROOT. > 5. Run make > > Some errors I encoutered and their fixes (workarounds), while trying as > much as I can leave the sources untouched: > 1. syscall.h not found. In some files, the is included. In NDK > SYSROOT the syscall.h lays in sys/ > FIX: created a link: SYSROOT/include/syscall.h -> > SYSROOT/include/sys/syscall.h > 2. Android's libraries includes the pthread lib automatically, thus not > having a stand-alone pthread library. > FIX: removed "-lpthread" from Makefile.am, tests/Makefile.am > 3. static declaration of "gettid" follows non-static declaration (in > SYSROOT/include/unistd.h, "gettid" is declared as "external") > For the mean time I commented this declaration... Maybe adding "#ifndef > gettid" before the declaration of "static gettid" in the sources will fix > it ? > 4. rand_r not declared - added a module that implements rand_r (as seen in > https://github.com/xbmc/xbmc/tree/master/xbmc/android/bionic_supplement) > 5. undefined reference to rpl_malloc > FIX: setting ac_cv_func_malloc_0_nonnull=yes before launching ./configure. > > now, after running ./configure and make, still not completed. I get many > "undefined reference to __sync_syncronize" messages. the > urcu/arch/generic.h defines the memory barriers functions as cmm_* but > their implementation is not taken from urcu/arch/arm.h but from Line 46 in > the same file (generic.h). > Can u help with this? > Am I missing something here ? > > Also, how does the build system use the kernel 3.0.31 (or any other) > sysroot ? > > Thank you > > Amit. > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Daniel.Thibault at drdc-rddc.gc.ca Thu Feb 21 10:25:17 2013 From: Daniel.Thibault at drdc-rddc.gc.ca (Thibault, Daniel) Date: Thu, 21 Feb 2013 15:25:17 +0000 Subject: [lttng-dev] Where are the live heads of lttng-tools and babeltrace? Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD01C6AA@VAL-E-01.valcartier.drdc-rddc.gc.ca> According to http://git.dorsal.polymtl.ca/?p=lttngtop.git;a=shortlog;h=refs/heads/live README (2012-Aug-30), one needs special versions of the lttng-tools and babeltrace packages in order to experiment with the live lttngtop alpha/beta. For technical reasons, I can't use git: directly and usually just fetch tarballs from the http: version instead. But in this case http://git.dorsal.polymtl.ca/~jdesfossez/lttng-tools gets me nowhere (the browser never finishes loading the page (IE), or gives up with a warning (Firefox)), http://git.dorsal.polymtl.ca has no lttng-tools branch, and the http://git.lttng.org lttng-tools repository has no live head. Likewise for babeltrace: http://git.dorsal.polymtl.ca/~jdesfossez/babeltrace is unreachable, http://git.dorsal.polymtl.ca has no babeltrace branch, and the http://git.efficios.com babeltrace repository has no live head. Where can the live lttngtop versions of lttng-tools and babeltrace be found? Daniel U. Thibault R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) / Defence R&D Canada - Valcartier (DRDC Valcartier) Cyber s?curit? pour les missions essentielles (CME) / Mission Critical Cyber Security (MCCS) Protection des syst?mes et contremesures (PSC) / Systems Protection & Countermeasures (SPC) 2459 route de la Bravoure Qu?bec, QC? G3J 1X5 CANADA Vox?: (418) 844-4000 x4245 Fax?: (418) 844-4538 NAC?: 918V QSDJ Gouvernement du Canada?/ Government of Canada From jdesfossez at efficios.com Thu Feb 21 11:16:11 2013 From: jdesfossez at efficios.com (Julien Desfossez) Date: Thu, 21 Feb 2013 11:16:11 -0500 Subject: [lttng-dev] Where are the live heads of lttng-tools and babeltrace? In-Reply-To: <48CF5AC71E61DB46B70D0F388054EFFD01C6AA@VAL-E-01.valcartier.drdc-rddc.gc.ca> References: <48CF5AC71E61DB46B70D0F388054EFFD01C6AA@VAL-E-01.valcartier.drdc-rddc.gc.ca> Message-ID: <5126484B.4010208@efficios.com> Hello Daniel, The gitwebs for these branches are : http://git.dorsal.polymtl.ca/~jdesfossez?p=lttng-tools;a=shortlog;h=refs/heads/lttngtop-live http://git.dorsal.polymtl.ca/~jdesfossez?p=babeltrace;a=shortlog;h=refs/heads/lttngtop-live But there are no tarballs for these branches since there are no releases. It is usually only 2 or 3 commits on top of the lttng-tools/babeltrace commit at the last time I rebased the branches. If you want to try this, I could also export you the tarballs somewhere, but please keep in mind that these versions are proofs-of-concept and nowhere near what the final implementations will look like. The reason we use separate branches not mainlined is because for now lttngtop-live relies on non-exported functions both from lttng-tools and babeltrace (these functions are private for good reasons and should not be exported as is, that is why I insist on the proof-of-concept state). When we will start implementing the live API cleanly, the interface will be completely different, that should happen around june. Thanks, Julien On 13-02-21 10:25 AM, Thibault, Daniel wrote: > According to http://git.dorsal.polymtl.ca/?p=lttngtop.git;a=shortlog;h=refs/heads/live README (2012-Aug-30), one needs special versions of the lttng-tools and babeltrace packages in order to experiment with the live lttngtop alpha/beta. For technical reasons, I can't use git: directly and usually just fetch tarballs from the http: version instead. > > But in this case http://git.dorsal.polymtl.ca/~jdesfossez/lttng-tools gets me nowhere (the browser never finishes loading the page (IE), or gives up with a warning (Firefox)), http://git.dorsal.polymtl.ca has no lttng-tools branch, and the http://git.lttng.org lttng-tools repository has no live head. > > Likewise for babeltrace: http://git.dorsal.polymtl.ca/~jdesfossez/babeltrace is unreachable, http://git.dorsal.polymtl.ca has no babeltrace branch, and the http://git.efficios.com babeltrace repository has no live head. > > Where can the live lttngtop versions of lttng-tools and babeltrace be found? > > Daniel U. Thibault > R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) / Defence R&D Canada - Valcartier (DRDC Valcartier) > Cyber s?curit? pour les missions essentielles (CME) / Mission Critical Cyber Security (MCCS) > Protection des syst?mes et contremesures (PSC) / Systems Protection & Countermeasures (SPC) > 2459 route de la Bravoure > Qu?bec, QC G3J 1X5 > CANADA > Vox : (418) 844-4000 x4245 > Fax : (418) 844-4538 > NAC : 918V QSDJ > Gouvernement du Canada / Government of Canada > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > From jistone at redhat.com Thu Feb 21 12:27:06 2013 From: jistone at redhat.com (Josh Stone) Date: Thu, 21 Feb 2013 09:27:06 -0800 Subject: [lttng-dev] Where are the live heads of lttng-tools and babeltrace? In-Reply-To: <5126484B.4010208@efficios.com> References: <48CF5AC71E61DB46B70D0F388054EFFD01C6AA@VAL-E-01.valcartier.drdc-rddc.gc.ca> <5126484B.4010208@efficios.com> Message-ID: <512658EA.6060105@redhat.com> On 02/21/2013 08:16 AM, Julien Desfossez wrote: > The gitwebs for these branches are : > http://git.dorsal.polymtl.ca/~jdesfossez?p=lttng-tools;a=shortlog;h=refs/heads/lttngtop-live > http://git.dorsal.polymtl.ca/~jdesfossez?p=babeltrace;a=shortlog;h=refs/heads/lttngtop-live > > But there are no tarballs for these branches since there are no releases. The "snapshot" link next to each commit will give you a tarball. From pierre-luc.st-charles at polymtl.ca Thu Feb 21 13:37:57 2013 From: pierre-luc.st-charles at polymtl.ca (Pierre-Luc St-Charles) Date: Thu, 21 Feb 2013 13:37:57 -0500 Subject: [lttng-dev] compiling LTTng for android In-Reply-To: References: Message-ID: Hey Amit, For the gettid issue, we were considering adding a #ifndef __ANDROID__ (all mentions of gettid in urcu) #endif type of solution (which seems to work for us at the moment), which also brings us to the last point: __ANDROID__ should be defined by default whenever you compile with the NDK's toolchain (we have not added this variable anywhere ourselves and so far, it's been very useful in all the projects). As for the patch itself, I personally have no clue if this would break any convention already in place for liburcu/LTTng in general; we have not been pushing any part of our progression so far as nothing as been tested, and some changes we made locally are extremely device/version specific (and would most likely break functionalities in other environments). For the syscall.h issue, we avoided including directly "$SYSROOT/usr/include/sys", since some files in that folder are not safe to use directly (see errno.h and statfs.h for example). This seems to be the 'agreed-upon' logic used in the AOSP source tree; possible alternatives are setting up new Android #ifdef barriers in liburcu itself, or trying to push an empty, logically linked syscall.h file (identical the above errno.h and statfs.h) to "$SYSROOT/usr/include" (which would probably not be accepted in the AOSP source). If your next plan after liburcu is porting the LTTng modules to Android, you'll most likely hit the missing kernel config options (syscall/hook related) in 3.0.x like we did; this will require some specific patching we have yet to complete. This work has been done in Torvalds's kernel (post-3.5 I believe, see his git for more info), but considering how different the current Android device kernels still are from the official ones, we might still have a lot to do. On another note, we peeked a little bit into porting UST to Android, but here again, replacing the SysV shmem implementation by Android's ashmem proved a lot more complicated than we had anticipated. Currently, we are only focusing on kernel tracing, so LTTng-modules + liburcu + LTTng-tools. So far, we successfully built the modules (with limited support), liburcu and the tools (also with limited support), but we have yet to start tracing. Feel free to ask away if you have any more questions, although other people on the mailing list might have better answers for LTTng-related questions. -PL On Thu, Feb 21, 2013 at 12:08 PM, Amit Balboul wrote: > Hey Pierre, > Thank you for the fast response. > > I'm also using the pre-built NDK environment (r8d), > I continue to work on it, I'll let you know if I'm still having those > errors. > About the "static inline pid_t gettid(void)" issue: > I cannot find any better solution than modifying the userspace-rcu sources > to avoid static declaration. > I dont see the connection to building to Android, because unistd.h > "extern"s gettid anyway, so it cannot be defined as static in any of the > files (i just removed the "static" from the inline definition). > > How do you want me to make this patch ? > > About the syscall.h issue: > applying the SYSROOT/usr/include/sys folder AFTER the SYSROOT/usr/include > in the CPPFLAGS solves the issue (looks like it is better than the link > solution). > > About the __ANDROID__ definition: > May I add this symbol to configure.ac and use it in the sources, ? > > > Amit. > > > > > On Thu, Feb 21, 2013 at 3:18 PM, Pierre-Luc St-Charles < > pierre-luc.st-charles at polymtl.ca> wrote: > >> Forwarded to mailing list: >> >> Hey Amil, >> >> Sorry we kept you out of the loop, we've been struggling on some issues >> in the later projects; as for liburcu, we've come across the same problems >> you cited, except the last one: >> - syscall.h / lpthread / gettid : your solutions, or a #ifdef >> __ANDROID__ barrier, seems to work as a temp fix. >> - rand_r : after substituting for the regular (not-thread-safe) rand, >> we decide to go with our own implementation, but the one you found might >> actually be better >> - rpl_malloc : same fix here, but we also found >> that ac_cv_func_realloc_0_nonnull *might* also help in some cases (along >> with ac_cv_func_malloc_0_nonnull) >> >> As for the __sync_synchronize error, we haven't encountered those and we >> managed to successfully build the library. >> >> Possible differences: >> We opted for AOSP's own pre-built & packaged NDK toolchain, (which can be >> found here: http://developer.android.com/tools/sdk/ndk/index.html) and >> pointed the sysroot variable to its platforms/android-14/arch-arm/ >> directory (latest). By default, it doesn't include some >> module/kernel headers, but it should be enough for liburcu. We are >> currently considering adding the liburcu project itself (along with the >> others) directly in the android external modules, so that it may be >> compiled with exactly the SAME settings as the rest of the >> libraries/binaries/modules, using the same NDK (but for that, we'll need to >> drop the autoconf/automake stuff, and that's another story). >> >> The rest should be identical, we might have used some extra parameters >> here and there that might be based on our environment in the build process, >> but here they are anyway: >> in ./configure, add : --target=arm-linux-androideabi >> --prefix=$SYSROOT/usr >> make sure you provide $SYSROOT/usr/lib instead of $SYSROOT/lib as the >> default library path >> >> Keep us informed if the problem still happens, we'll try to debug your >> issue further. >> >> On Thu, Feb 21, 2013 at 5:13 AM, Amit Balboul wrote: >> >>> Hi all, >>> >>> In continue to posts from >>> http://www.mail-archive.com/lttng-dev at lists.lttng.org/msg02542.html, >>> >>> I'm trying to build the LTTng kernel-tracer for Android on ARM: >>> (JB4.2.1 - kernel 3.0.31 - on Galaxy Nexus). >>> I'm having some trouble completing the process, didn't find any usable >>> information so far, maybe u can help. >>> >>> I want to build the: (I've managed in the past to build the modules for >>> goldfish's 2.6.29 but this required patching the kernel). >>> (1) userspace-rcu >>> (2) modules >>> (3) tools >>> I'm currently stuck in the first phase (building userspace-rcu). >>> >>> My steps and the issues I've encountered are: >>> 1. Clone the userspace-rcu git repository >>> 2. Generate a sysroot for arm-linux-androideabi from google's NDK (using >>> its "make-standalone-toolchain.sh" script with arm-linux-androideabi-4.4.3 >>> toolchain). >>> 3. Run ./bootstrap - creating config.h.in, Makefile.in, configure, ... >>> 4. Run ./configure with --host=arm-linux-androideabi and the relevant >>> environment variables (CC, LD, CPPFLAGS, CFLAGS, LDFLAGS, LIB), pointing to >>> the NDK ARM SYSROOT. >>> 5. Run make >>> >>> Some errors I encoutered and their fixes (workarounds), while trying as >>> much as I can leave the sources untouched: >>> 1. syscall.h not found. In some files, the is included. In >>> NDK SYSROOT the syscall.h lays in sys/ >>> FIX: created a link: SYSROOT/include/syscall.h -> >>> SYSROOT/include/sys/syscall.h >>> 2. Android's libraries includes the pthread lib automatically, thus not >>> having a stand-alone pthread library. >>> FIX: removed "-lpthread" from Makefile.am, tests/Makefile.am >>> 3. static declaration of "gettid" follows non-static declaration (in >>> SYSROOT/include/unistd.h, "gettid" is declared as "external") >>> For the mean time I commented this declaration... Maybe adding "#ifndef >>> gettid" before the declaration of "static gettid" in the sources will fix >>> it ? >>> 4. rand_r not declared - added a module that implements rand_r (as seen >>> in >>> https://github.com/xbmc/xbmc/tree/master/xbmc/android/bionic_supplement) >>> 5. undefined reference to rpl_malloc >>> FIX: setting ac_cv_func_malloc_0_nonnull=yes before launching >>> ./configure. >>> >>> now, after running ./configure and make, still not completed. I get many >>> "undefined reference to __sync_syncronize" messages. the >>> urcu/arch/generic.h defines the memory barriers functions as cmm_* but >>> their implementation is not taken from urcu/arch/arm.h but from Line 46 in >>> the same file (generic.h). >>> Can u help with this? >>> Am I missing something here ? >>> >>> Also, how does the build system use the kernel 3.0.31 (or any other) >>> sysroot ? >>> >>> Thank you >>> >>> Amit. >>> >>> _______________________________________________ >>> lttng-dev mailing list >>> lttng-dev at lists.lttng.org >>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Daniel.Thibault at drdc-rddc.gc.ca Thu Feb 21 13:50:28 2013 From: Daniel.Thibault at drdc-rddc.gc.ca (Thibault, Daniel) Date: Thu, 21 Feb 2013 18:50:28 +0000 Subject: [lttng-dev] Where are the live heads of lttng-tools and babeltrace? In-Reply-To: <5126484B.4010208@efficios.com> References: <48CF5AC71E61DB46B70D0F388054EFFD01C6AA@VAL-E-01.valcartier.drdc-rddc.gc.ca> <5126484B.4010208@efficios.com> Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD01C713@VAL-E-01.valcartier.drdc-rddc.gc.ca> -----Message d'origine----- De?: Julien Desfossez [mailto:jdesfossez at efficios.com] Envoy??: 21 f?vrier 2013 11:16 The gitwebs for these branches are : http://git.dorsal.polymtl.ca/~jdesfossez?p=lttng-tools;a=shortlog;h=refs/heads/lttngtop-live http://git.dorsal.polymtl.ca/~jdesfossez?p=babeltrace;a=shortlog;h=refs/heads/lttngtop-live But there are no tarballs for these branches since there are no releases. -----Fin du message d'origine----- Thanks. Google couldn't find them, and they're not advertised by the git.dorsal.polymtl.ca home page. You can't even find them by using git.dorsal.polymtl.ca's Search box. By "tarball" I meant the 'snapshot' facility gitweb offers, so there's no need to trouble yourself with making actual tarballs. Daniel U. Thibault R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) / Defence R&D Canada - Valcartier (DRDC Valcartier) Cyber s?curit? pour les missions essentielles (CME) / Mission Critical Cyber Security (MCCS) Protection des syst?mes et contremesures (PSC) / Systems Protection & Countermeasures (SPC) 2459 route de la Bravoure Qu?bec, QC G3J 1X5 CANADA Vox : (418) 844-4000 x4245 Fax : (418) 844-4538 NAC : 918V QSDJ Gouvernement du Canada / Government of Canada From Daniel.Thibault at drdc-rddc.gc.ca Thu Feb 21 15:07:37 2013 From: Daniel.Thibault at drdc-rddc.gc.ca (Thibault, Daniel) Date: Thu, 21 Feb 2013 20:07:37 +0000 Subject: [lttng-dev] Typo in lttngtop.c Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD01C763@VAL-E-01.valcartier.drdc-rddc.gc.ca> check_field_requirements() reads in part: if (*tid_check == 0) { if (strncmp(name, "tid", 3) == 0) (*tid_check)++; } if (*pid_check == 0) { if (strncmp(name, "tid", 3) == 0) (*pid_check)++; } Shouldn't that second if check for "pid" instead of "tid"? Daniel U. Thibault R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) / Defence R&D Canada - Valcartier (DRDC Valcartier) Cyber s?curit? pour les missions essentielles (CME) / Mission Critical Cyber Security (MCCS) Protection des syst?mes et contremesures (PSC) / Systems Protection & Countermeasures (SPC) 2459 route de la Bravoure Qu?bec, QC? G3J 1X5 CANADA Vox?: (418) 844-4000 x4245 Fax?: (418) 844-4538 NAC?: 918V QSDJ Gouvernement du Canada?/ Government of Canada From julien.desfossez at polymtl.ca Thu Feb 21 15:21:31 2013 From: julien.desfossez at polymtl.ca (Julien Desfossez) Date: Thu, 21 Feb 2013 15:21:31 -0500 Subject: [lttng-dev] Typo in lttngtop.c In-Reply-To: <48CF5AC71E61DB46B70D0F388054EFFD01C763@VAL-E-01.valcartier.drdc-rddc.gc.ca> References: <48CF5AC71E61DB46B70D0F388054EFFD01C763@VAL-E-01.valcartier.drdc-rddc.gc.ca> Message-ID: <512681CB.2060508@polymtl.ca> On 13-02-21 03:07 PM, Thibault, Daniel wrote: > check_field_requirements() reads in part: > > if (*tid_check == 0) { > if (strncmp(name, "tid", 3) == 0) > (*tid_check)++; > } > if (*pid_check == 0) { > if (strncmp(name, "tid", 3) == 0) > (*pid_check)++; > } > > Shouldn't that second if check for "pid" instead of "tid"? Indeed. Fixed in master and live branches. Thanks, Julien > > Daniel U. Thibault > R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) / Defence R&D Canada - Valcartier (DRDC Valcartier) > Cyber s?curit? pour les missions essentielles (CME) / Mission Critical Cyber Security (MCCS) > Protection des syst?mes et contremesures (PSC) / Systems Protection & Countermeasures (SPC) > 2459 route de la Bravoure > Qu?bec, QC G3J 1X5 > CANADA > Vox : (418) 844-4000 x4245 > Fax : (418) 844-4538 > NAC : 918V QSDJ > Gouvernement du Canada / Government of Canada > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > From simon.marchi at polymtl.ca Thu Feb 21 20:28:48 2013 From: simon.marchi at polymtl.ca (Simon Marchi) Date: Thu, 21 Feb 2013 20:28:48 -0500 Subject: [lttng-dev] Stream trace data over PCIe (or anything else) Message-ID: Hello LTTng cyborgs, As some of you might know, I am trying to port and adapt LTTng to the Tilera TILEncore-Gx card (and later the Intel Xeon Phi). The main constraint with these platforms is the non existent disk space, which means the trace will have to be streamed. I am thinking of using the PCI express connection the two cards have to stream the trace data and save it on the host. It seems like this use case is similar to what the network consumer and relayd offer, but simply on another medium. The consumer currently has two destination types: local and net (enum consumer_dst_type in bin/lttng-sessiond/consumer.h). I understand that I could create another type of consumer which sends data over the PCI port instead. On the other side of the bus, I could adapt relayd to receive on the PCI port of the host and save the trace as it currently does for the network. I would like to hear your comments about this approach. Does it sound right, is there a better way ? Would it be worth it to design a system that would make it easier to add a new type of "transport" for the trace data ? Thanks ! Simon From mathieu.desnoyers at efficios.com Thu Feb 21 21:04:07 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 21 Feb 2013 21:04:07 -0500 Subject: [lttng-dev] Stream trace data over PCIe (or anything else) In-Reply-To: References: Message-ID: <20130222020407.GA15200@Krystal> * Simon Marchi (simon.marchi at polymtl.ca) wrote: > Hello LTTng cyborgs, > > As some of you might know, I am trying to port and adapt LTTng to the > Tilera TILEncore-Gx card (and later the Intel Xeon Phi). The main > constraint with these platforms is the non existent disk space, which > means the trace will have to be streamed. I am thinking of using the > PCI express connection the two cards have to stream the trace data and > save it on the host. It seems like this use case is similar to what > the network consumer and relayd offer, but simply on another medium. > > The consumer currently has two destination types: local and net (enum > consumer_dst_type in bin/lttng-sessiond/consumer.h). I understand that > I could create another type of consumer which sends data over the PCI > port instead. On the other side of the bus, I could adapt relayd to > receive on the PCI port of the host and save the trace as it currently > does for the network. > > I would like to hear your comments about this approach. Does it sound > right, is there a better way ? Would it be worth it to design a system > that would make it easier to add a new type of "transport" for the > trace data ? Is it possible to bind a network interface between the tilera and the host that uses the PCI express port ? Thanks, Mathieu > > Thanks ! > > Simon > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From simon.marchi at polymtl.ca Thu Feb 21 23:34:37 2013 From: simon.marchi at polymtl.ca (Simon Marchi) Date: Thu, 21 Feb 2013 23:34:37 -0500 Subject: [lttng-dev] Stream trace data over PCIe (or anything else) In-Reply-To: <20130222020407.GA15200@Krystal> References: <20130222020407.GA15200@Krystal> Message-ID: Yes indeed. When I first played with the card, I didn't get it to work so I forgot about this feature. I looked at it again and got it to work. I successfully streamed some events over the connection to relayd listening on the other side ! On 21 February 2013 21:04, Mathieu Desnoyers wrote: > * Simon Marchi (simon.marchi at polymtl.ca) wrote: >> Hello LTTng cyborgs, >> >> As some of you might know, I am trying to port and adapt LTTng to the >> Tilera TILEncore-Gx card (and later the Intel Xeon Phi). The main >> constraint with these platforms is the non existent disk space, which >> means the trace will have to be streamed. I am thinking of using the >> PCI express connection the two cards have to stream the trace data and >> save it on the host. It seems like this use case is similar to what >> the network consumer and relayd offer, but simply on another medium. >> >> The consumer currently has two destination types: local and net (enum >> consumer_dst_type in bin/lttng-sessiond/consumer.h). I understand that >> I could create another type of consumer which sends data over the PCI >> port instead. On the other side of the bus, I could adapt relayd to >> receive on the PCI port of the host and save the trace as it currently >> does for the network. >> >> I would like to hear your comments about this approach. Does it sound >> right, is there a better way ? Would it be worth it to design a system >> that would make it easier to add a new type of "transport" for the >> trace data ? > > Is it possible to bind a network interface between the tilera and the > host that uses the PCI express port ? > > Thanks, > > Mathieu > >> >> Thanks ! >> >> Simon >> >> _______________________________________________ >> lttng-dev mailing list >> lttng-dev at lists.lttng.org >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev From mathieu.desnoyers at efficios.com Fri Feb 22 07:57:50 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 22 Feb 2013 07:57:50 -0500 Subject: [lttng-dev] [PATCH 1/3] urcu: avoid "expression result unused" from clang In-Reply-To: <20121210140930.GA32034@Krystal> References: <1354872295-32371-1-git-send-email-laijs@cn.fujitsu.com> <20121207165848.GB12338@Krystal> <20121208150023.GA16943@Krystal> <50C54A07.20101@cn.fujitsu.com> <20121210140930.GA32034@Krystal> Message-ID: <20130222125750.GA21519@Krystal> * Mathieu Desnoyers (mathieu.desnoyers at efficios.com) wrote: > * Lai Jiangshan (laijs at cn.fujitsu.com) wrote: > > On 12/08/2012 11:00 PM, Mathieu Desnoyers wrote: > > > * Lai Jiangshan (eag0628 at gmail.com) wrote: > > >> How about the one in yy.diff? > > >> > > >> xx.diff fixes the one what I had sent in 1/3 patch, but it may still > > >> cause warning in future if the complier become more strict. > > > > > > Hrm. In any cases, I think that even with the 2 patches you propose, the > > > warning "unused expression return" would still be valid (because we end > > > up not using the result of the outer statement-expression). > > > > The one in yy.diff: > > > > 1 ? _v : statement_which_has_side_affect; > > > > The compiler should not warn for it. "?:" can be used for control flow, > > the complier should only warn if both branches are warning. > > In the case of yy.diff, whether the warning will appear or not would > depend on the phase at which the compiler generates the warning, no ? > For instance, it it chooses to check for unused return values after > eliminating dead code (considering branches that cannot be taken), then > we would be in the same situation as we are today, even if we have a > statement with side effect. > > I am more and more enclined to try asking their opinion to the clang > community about this. I finally found a way to silence warnings both in gcc and clang: diff --git a/urcu/system.h b/urcu/system.h index 2a45f22..6f31459 100644 --- a/urcu/system.h +++ b/urcu/system.h @@ -47,11 +47,11 @@ * Store v into x, where x is located in shared memory. Performs the * required cache flush after writing. Returns v. */ -#define CMM_STORE_SHARED(x, v) \ - ({ \ - __typeof__(x) _v = _CMM_STORE_SHARED(x, v); \ - cmm_smp_wmc(); \ - _v; \ +#define CMM_STORE_SHARED(x, v) \ + ({ \ + __typeof__(x) _v = _CMM_STORE_SHARED(x, v); \ + cmm_smp_wmc(); \ + _v = _v; /* Work around clang "unused result" */ \ }) #endif /* _URCU_SYSTEM_H */ Thanks, Mathieu > > Thanks, > > Mathieu > > > > > > > We might > > > want to consider simpler approaches: > > > > > > 1 - Add the missing (void) casts before each CMM_STORE_SHARED() in the > > > code. I don't like this because it makes the CMM_STORE_SHARED common > > > case more cumbersome to use. > > > 2 - Change the CMM_STORE_SHARED() API so it does not return anything. > > > I think most use-cases don't involve using its return value anyway. > > > > > > Thoughts ? > > > > > > Thanks, > > > > > > Mathieu > > > > > >> > > >> On Sat, Dec 8, 2012 at 1:27 AM, Lai Jiangshan wrote: > > >>> > > >>> > > >>> On Saturday, December 8, 2012, Mathieu Desnoyers wrote: > > >>>> > > >>>> * Lai Jiangshan (laijs at cn.fujitsu.com) wrote: > > >>>>> The last expression result is unused and clang will complain. > > >>>>> The trick in the patch supresses the complaint > > >>>> > > >>>> Hrm, but with this patch, gcc complains: > > >>>> > > >>>> rculfhash.c:1921:3: warning: variable '_w' set but not used > > >>>> [-Wunused-but-set-variable] > > >>>> > > >>>> using > > >>>> > > >>>> gcc version 4.7.2 (Debian 4.7.2-4) > > >>> > > >>> > > >>> Ouch, my gcc is too old > > >>> > > >>> > > >>>> > > >>>> > > >>>> Thoughts ? > > >>>> > > >>>> Thanks, > > >>>> > > >>>> Mathieu > > >>>> > > >>>>> > > >>>>> Signed-off-by: Lai Jiangshan > > >>>>> --- > > >>>>> urcu/system.h | 5 ++++- > > >>>>> 2 files changed, 4 insertions(+), 1 deletions(-) > > >>>>> > > >>>>> diff --git a/urcu/system.h b/urcu/system.h > > >>>>> index 2a45f22..6b7b0af 100644 > > >>>>> --- a/urcu/system.h > > >>>>> +++ b/urcu/system.h > > >>>>> @@ -46,12 +46,15 @@ > > >>>>> /* > > >>>>> * Store v into x, where x is located in shared memory. Performs the > > >>>>> * required cache flush after writing. Returns v. > > >>>>> + * "_w" here avoids the warning from clang: > > >>>>> + * warning: expression result unused [-Wunused-value] > > >>>>> */ > > >>>>> #define CMM_STORE_SHARED(x, v) \ > > >>>>> ({ \ > > >>>>> __typeof__(x) _v = _CMM_STORE_SHARED(x, v); \ > > >>>>> + __typeof__(x) _w; \ > > >>>>> cmm_smp_wmc(); \ > > >>>>> - _v; \ > > >>>>> + _w = _v; \ > > >>>>> }) > > >>>>> > > >>>>> #endif /* _URCU_SYSTEM_H */ > > >>>>> -- > > >>>>> 1.7.4.4 > > >>>>> > > >>>>> > > >>>>> _______________________________________________ > > >>>>> lttng-dev mailing list > > >>>>> lttng-dev at lists.lttng.org > > >>>>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > >>>> > > >>>> > > >>>> -- > > >>>> Mathieu Desnoyers > > >>>> Operating System Efficiency R&D Consultant > > >>>> EfficiOS Inc. > > >>>> http://www.efficios.com > > >>>> > > >>>> _______________________________________________ > > >>>> lttng-dev mailing list > > >>>> lttng-dev at lists.lttng.org > > >>>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > > > > > > > > > > > > > > > -- > Mathieu Desnoyers > Operating System Efficiency R&D Consultant > EfficiOS Inc. > http://www.efficios.com > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From Bernd.Hufmann at ericsson.com Fri Feb 22 08:36:46 2013 From: Bernd.Hufmann at ericsson.com (Bernd Hufmann) Date: Fri, 22 Feb 2013 08:36:46 -0500 Subject: [lttng-dev] Core dump with LTTng Tools v2.1.1 Message-ID: <5127746E.7080200@ericsson.com> Hello When executing the command "lttng list -k" and I get a core dump with the output below. This happens not all the time, but when it happens I have to kill the lttng-sessiond and restart the lttng-sessiond. I attached the core dump. Could someone of the LTTng team look into this? My computer has Ubuntu 12.04 with kernel 3.2.0-29. I've installed LTTng modules v2.1.1, LTTng-UST v2.1.1 and userspace-rcu v0.7.6. Thanks Bernd lttng list -k Kernel events: ------------- mm_vmscan_kswapd_sleep (loglevel: TRACE_EMERG (0)) (type: tracepoint) mm_vmscan_kswapd_wake (loglevel: TRACE_EMERG (0)) (type: tracepoint) mm_vmscan_wakeup_kswapd (loglevel: TRACE_EMERG (0)) (type: tracepoint) mm_vmscan_direct_reclaim_begin (loglevel: TRACE_EMERG (0)) (type: tracepoint) mm_vmscan_memcg_reclaim_begin (loglevel: TRACE_EMERG (0)) (type: tracepoint) mm_vmscan_memcg_softlimit_reclaim_begin (loglevel: TRACE_EMERG (0)) (type: tracepoint) mm_vmscan_direct_reclaim_end (loglevel: TRACE_EMERG (0)) (type: tracepoint) mm_vmscan_memcg_reclaim_end (loglevel: TRACE_EMERG (0)) (type: tracepoint) mm_vmscan_memcg_softlimit_reclaim_end (loglevel: TRACE_EMERG (0)) (type: tracepoint) mm_shrink_slab_start (loglevel: TRACE_EMERG (0)) (type: tracepoint) mm_shrink_slab_end (loglevel: TRACE_EMERG (0)) (type: tracepoint) mm_vmscan_lru_isolate (loglevel: TRACE_EMERG (0)) (type: tracepoint) mm_vmscan_memcg_isolate (loglevel: TRACE_EMERG (0)) (type: tracepoint) mm_vmscan_writepage (loglevel: TRACE_EMERG (0)) (type: tracepoint) mm_vmscan_lru_shrink_inactive (loglevel: TRACE_EMERG (0)) (type: tracepoint) replace_swap_token (loglevel: TRACE_EMERG (0)) (type: tracepoint) put_swap_token (loglevel: TRACE_EMERG (0)) (type: tracepoint) disable_swap_token (loglevel: TRACE_EMERG (0)) (type: tracepoint) update_swap_token_priority (loglevel: TRACE_EMERG (0)) (type: tracepoint) udp_fail_queue_rcv_skb (loglevel: TRACE_EMERG (0)) (type: tracepoint) timer_init (loglevel: TRACE_EMERG (0)) (type: tracepoint) timer_start (loglevel: TRACE_EMERG (0)) (type: tracepoint) timer_expire_entry (loglevel: TRACE_EMERG (0)) (type: tracepoint) timer_expire_exit (loglevel: TRACE_EMERG (0)) (type: tracepoint) timer_cancel (loglevel: TRACE_EMERG (0)) (type: tracepoint) hrtimer_init (loglevel: TRACE_EMERG (0)) (type: tracepoint) hrtimer_start (loglevel: TRACE_EMERG (0)) (type: tracepoint) hrtimer_expire_entry (loglevel: TRACE_EMERG (0)) (type: tracepoint) hrtimer_expire_exit (loglevel: TRACE_EMERG (0)) (type: tracepoint) hrtimer_cancel (loglevel: TRACE_EMERG (0)) (type: tracepoint) itimer_state (loglevel: TRACE_EMERG (0)) (type: tracepoint) itimer_expire (loglevel: TRACE_EMERG (0)) (type: tracepoint) lttng_statedump_start (loglevel: TRACE_EMERG (0)) (type: tracepoint) lttng_statedump_end (loglevel: TRACE_EMERG (0)) (type: tracepoint) lttng_statedump_process_state (loglevel: TRACE_EMERG (0)) (type: tracepoint) lttng_statedump_file_descriptor (loglevel: TRACE_EMERG (0)) (type: tracepoint) lttng_statedump_vm_map (loglevel: TRACE_EMERG (0)) (type: tracepoint) lttng_statedump_network_interface (loglevel: TRACE_EMERG (0)) (type: tracepoint) lttng_statedump_interrupt (loglevel: TRACE_EMERG (0)) (type: tracepoint) sock_rcvqueue_full (loglevel: TRACE_EMERG (0)) (type: tracepoint) sock_exceed_buf_limit (loglevel: TRACE_EMERG (0)) (type: tracepoint) kfree_skb (loglevel: TRACE_EMERG (0)) (type: tracepoint) consume_skb (loglevel: TRACE_EMERG (0)) (type: tracepoint) skb_copy_datagram_iovec (loglevel: TRACE_EMERG (0)) (type: tracepoint) signal_generate (loglevel: TRACE_EMERG (0)) (type: tracepoint) signal_deliver (loglevel: TRACE_EMERG (0)) (type: tracepoint) signal_overflow_fail (loglevel: TRACE_EMERG (0)) (type: tracepoint) signal_lose_info (loglevel: TRACE_EMERG (0)) (type: tracepoint) scsi_dispatch_cmd_start (loglevel: TRACE_EMERG (0)) (type: tracepoint) scsi_dispatch_cmd_error (loglevel: TRACE_EMERG (0)) (type: tracepoint) scsi_dispatch_cmd_done (loglevel: TRACE_EMERG (0)) (type: tracepoint) scsi_dispatch_cmd_timeout (loglevel: TRACE_EMERG (0)) (type: tracepoint) scsi_eh_wakeup (loglevel: TRACE_EMERG (0)) (type: tracepoint) sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) sched_wakeup (loglevel: TRACE_EMERG (0)) (type: tracepoint) sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) sched_switch (loglevel: TRACE_EMERG (0)) (type: tracepoint) sched_migrate_task (loglevel: TRACE_EMERG (0)) (type: tracepoint) sched_process_free (loglevel: TRACE_EMERG (0)) (type: tracepoint) sched_process_exit (loglevel: TRACE_EMERG (0)) (type: tracepoint) sched_wait_task (loglevel: TRACE_EMERG (0)) (type: tracepoint) sched_process_wait (loglevel: TRACE_EMERG (0)) (type: tracepoint) sched_process_fork (loglevel: TRACE_EMERG (0)) (type: tracepoint) sched_stat_wait (loglevel: TRACE_EMERG (0)) (type: tracepoint) sched_stat_sleep (loglevel: TRACE_EMERG (0)) (type: tracepoint) sched_stat_iowait (loglevel: TRACE_EMERG (0)) (type: tracepoint) sched_stat_runtime (loglevel: TRACE_EMERG (0)) (type: tracepoint) sched_pi_setprio (loglevel: TRACE_EMERG (0)) (type: tracepoint) regulator_enable (loglevel: TRACE_EMERG (0)) (type: tracepoint) regulator_enable_delay (loglevel: TRACE_EMERG (0)) (type: tracepoint) regulator_enable_complete (loglevel: TRACE_EMERG (0)) (type: tracepoint) regulator_disable (loglevel: TRACE_EMERG (0)) (type: tracepoint) regulator_disable_complete (loglevel: TRACE_EMERG (0)) (type: tracepoint) regulator_set_voltage (loglevel: TRACE_EMERG (0)) (type: tracepoint) regulator_set_voltage_complete (loglevel: TRACE_EMERG (0)) (type: tracepoint) (type: noop) cpu_frequency (loglevel: TRACE_EMERG (0)) (type: tracepoint) machine_suspend (loglevel: TRACE_EMERG (0)) (type: tracepoint) power_start (loglevel: TRACE_EMERG (0)) (type: tracepoint) power_frequency (loglevel: TRACE_EMERG (0)) (type: tracepoint) power_end (loglevel: TRACE_EMERG (0)) (type: tracepoint) clock_enable (loglevel: TRACE_EMERG (0)) (type: tracepoint) clock_disable (loglevel: TRACE_EMERG (0)) (type: tracepoint) clock_set_rate (loglevel: TRACE_EMERG (0)) (type: tracepoint) power_domain_target (loglevel: TRACE_EMERG (0)) (type: tracepoint) net_dev_xmit (loglevel: TRACE_EMERG (0)) (type: tracepoint) net_dev_queue (loglevel: TRACE_EMERG (0)) (type: tracepoint) netif_receive_skb (loglevel: TRACE_EMERG (0)) (type: tracepoint) netif_rx (loglevel: TRACE_EMERG (0)) (type: tracepoint) napi_poll (loglevel: TRACE_EMERG (0)) (type: tracepoint) module_load (loglevel: TRACE_EMERG (0)) (type: tracepoint) module_free (loglevel: TRACE_EMERG (0)) (type: tracepoint) module_get (loglevel: TRACE_EMERG (0)) (type: tracepoint) module_put (loglevel: TRACE_EMERG (0)) (type: tracepoint) module_request (loglevel: TRACE_EMERG (0)) (type: tracepoint) kvm_userspace_exit (loglevel: TRACE_EMERG (0)) (type: tracepoint) kvm_set_irq (loglevel: TRACE_EMERG (0)) (type: tracepoint) kvm_msi_set_irq (loglevel: TRACE_EMERG (0)) (type: tracepoint) kvm_ack_irq (loglevel: TRACE_EMERG (0)) (type: tracepoint) kvm_mmio (loglevel: TRACE_EMERG (0)) (type: tracepoint) kvm_fpu (loglevel: TRACE_EMERG (0)) (type: tracepoint) kvm_age_page (loglevel: TRACE_EMERG (0)) (type: tracepoint) kvm_try_async_get_page (loglevel: TRACE_EMERG (0)) (type: tracepoint) kvm_async_pf_doublefault (loglevel: TRACE_EMERG (0)) (type: tracepoint) kvm_async_pf_not_present (loglevel: TRACE_EMERG (0)) (type: tracepoint) kvm_async_pf_ready (loglevel: TRACE_EMERG (0)) (type: tracepoint) kvm_async_pf_completed (loglevel: TRACE_EMERG (0)) (type: tracepoint) kmalloc (loglevel: TRACE_EMERG (0)) (type: tracepoint) kmem_cache_alloc (loglevel: TRACE_EMERG (0)) (type: tracepoint) kmalloc_node (loglevel: TRACE_EMERG (0)) (type: tracepoint) kmem_cache_alloc_node (loglevel: TRACE_EMERG (0)) (type: tracepoint) kfree (loglevel: TRACE_EMERG (0)) (type: tracepoint) kmem_cache_free (loglevel: TRACE_EMERG (0)) (type: tracepoint) mm_page_free_direct (loglevel: TRACE_EMERG (0)) (type: tracepoint) lttng: commands/list.c:253: print_events: Assertion `0' failed. Aborted (core dumped) -- This Communication is Confidential. We only send and receive email on the basis of the terms set out at www.ericsson.com/email_disclaimer -------------- next part -------------- A non-text attachment was scrubbed... Name: core.zip Type: application/zip Size: 34294 bytes Desc: not available URL: From mathieu.desnoyers at efficios.com Fri Feb 22 08:45:15 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 22 Feb 2013 08:45:15 -0500 Subject: [lttng-dev] Package liburcu fix for kfreebsd-amd64 and kfreebsd-i386 Message-ID: <20130222134515.GA22069@Krystal> Hi, I noticed failures to build for the liburcu Debian package for kfreebsd-amd64 and kfreebsd-i386. I just pushed a commit into the master branch that should solve the build errors encountered. Would it be possible to test a build of Userspace RCU master branch against those two architectures ? If it works fine, then I could backport this commit into the stable-0.7 branch. commit 63b495d8b20ff76ba08d823df2e9702acc936beb Author: Mathieu Desnoyers Date: Fri Feb 22 08:35:37 2013 -0500 Fix build on architectures with HAVE_SCHED_GETCPU but without HAVE_SYSCONF Noticed on: https://buildd.debian.org/status/package.php?p=liburcu Tail of log for liburcu on kfreebsd-amd64: CC urcu.lo In file included from urcu.c:450:0: urcu-call-rcu-impl.h:145:12: error: static declaration of 'sched_getcpu' follows non-static declaration In file included from /usr/include/sched.h:43:0, from /usr/include/pthread.h:20, from urcu.c:30: /usr/include/x86_64-kfreebsd-gnu/bits/sched.h:65:12: note: previous declaration of 'sched_getcpu' was here make[3]: *** [urcu.lo] Error 1 make[3]: Leaving directory `/build/buildd-liburcu_0.7.6-1-kfreebsd-amd64-nnkICd/liburcu-0.7.6' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/build/buildd-liburcu_0.7.6-1-kfreebsd-amd64-nnkICd/liburcu-0.7.6' make[1]: *** [all] Error 2 make[1]: Leaving directory `/build/buildd-liburcu_0.7.6-1-kfreebsd-amd64-nnkICd/liburcu-0.7.6' dh_auto_build: make -j1 returned exit code 2 make: *** [build-arch] Error 2 Tail of log for liburcu on kfreebsd-i386: CC urcu.lo In file included from urcu.c:450:0: urcu-call-rcu-impl.h:145:12: error: static declaration of 'sched_getcpu' follows non-static declaration In file included from /usr/include/sched.h:43:0, from /usr/include/pthread.h:20, from urcu.c:30: /usr/include/i386-kfreebsd-gnu/bits/sched.h:65:12: note: previous declaration of 'sched_getcpu' was here make[3]: *** [urcu.lo] Error 1 make[3]: Leaving directory `/build/buildd-liburcu_0.7.6-1-kfreebsd-i386-sWzNKU/liburcu-0.7.6' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/build/buildd-liburcu_0.7.6-1-kfreebsd-i386-sWzNKU/liburcu-0.7.6' make[1]: *** [all] Error 2 make[1]: Leaving directory `/build/buildd-liburcu_0.7.6-1-kfreebsd-i386-sWzNKU/liburcu-0.7.6' dh_auto_build: make -j1 returned exit code 2 make: *** [build-arch] Error 2 Signed-off-by: Mathieu Desnoyers Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Fri Feb 22 09:09:20 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 22 Feb 2013 09:09:20 -0500 Subject: [lttng-dev] Package liburcu: build for hurd-i386 Message-ID: <20130222140920.GA22156@Krystal> Hi, I noticed a build failure on hurd-i386, and committed a fix in Userspace RCU master branch to address this issue. Testing would be welcome. If it helps, then I might consider backporting this fix into the stable-0.7 branch. commit 2953b501ab1dcf908d07de9b414a08397519f5b6 Author: Mathieu Desnoyers Date: Fri Feb 22 09:05:32 2013 -0500 Fix tests: finer-grained use of CPU_SET, CPU_ZERO and cpu_set_t Noticed build failure at https://buildd.debian.org/status/package.php?p=liburcu : Tail of log for liburcu on hurd-i386: test_urcu.c:110:0: warning: "CPU_SET" redefined [enabled by default] In file included from /usr/include/pthread/pthread.h:50:0, from /usr/include/pthread.h:2, from test_urcu.c:26: /usr/include/sched.h:80:0: note: this is the location of the previous defini make[3]: *** [test_urcu.o] Error 1 make[2]: *** [all-recursive] Error 1 make[1]: *** [all] Error 2 dh_auto_build: make -j1 returned exit code 2 make: *** [build-arch] Error 2 dpkg-buildpackage: error: debian/rules build-arch gave error exit status 2 make[3]: Entering directory `/build/buildd-liburcu_0.7.6-1-hurd-i386-wGBAtt/ CC test_urcu.o make[3]: Leaving directory `/build/buildd-liburcu_0.7.6-1-hurd-i386-wGBAtt/l make[2]: Leaving directory `/build/buildd-liburcu_0.7.6-1-hurd-i386-wGBAtt/l Signed-off-by: Mathieu Desnoyers commit fe1f98621fe1cfafdf66c332a004e2a8c8397b2a Author: Mathieu Desnoyers Date: Fri Feb 22 08:50:49 2013 -0500 Test for CPU_SET Signed-off-by: Mathieu Desnoyers Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Fri Feb 22 09:15:51 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 22 Feb 2013 09:15:51 -0500 Subject: [lttng-dev] liburcu sparc support, build failure on buildd Message-ID: <20130222141551.GB22156@Krystal> Hi, I notice the following build failure here https://buildd.debian.org/status/package.php?p=liburcu Tail of log for liburcu on sparc: urcu/static/wfqueue.h:84:2: warning: implicit declaration of function 'CMM_STORE_SHARED' [-Wimplicit-function-declaration] urcu/static/wfqueue.h: In function '___cds_wfq_node_sync_next': urcu/static/wfqueue.h:99:2: warning: implicit declaration of function 'CMM_LOAD_SHARED' [-Wimplicit-function-declaration] urcu/static/wfqueue.h:99:15: warning: assignment makes pointer from integer without a cast [enabled by default] urcu/static/wfqueue.h:104:4: warning: implicit declaration of function 'caa_cpu_relax' [-Wimplicit-function-declaration] urcu/static/wfqueue.h: In function '___cds_wfq_dequeue_blocking': urcu/static/wfqueue.h:126:55: warning: comparison between pointer and integer [enabled by default] make[3]: *** [wfqueue.lo] Error 1 make[3]: Leaving directory `/build/buildd-liburcu_0.7.6-1-sparc-GySyug/liburcu-0.7.6' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/build/buildd-liburcu_0.7.6-1-sparc-GySyug/liburcu-0.7.6' make[1]: *** [all] Error 2 make[1]: Leaving directory `/build/buildd-liburcu_0.7.6-1-sparc-GySyug/liburcu-0.7.6' dh_auto_build: make -j1 returned exit code 2 make: *** [build-arch] Error 2 One main question I have: what sparc architectures are supported by Debian's "sparc" architecture ? Userspace RCU only supports Sparcv9 and onward, because it requires some atomic instructions. As documented in the urcu README file, building a package that includes sparcv9 isntructions for 32-bit sparc can be done with: CFLAGS="-m32 -Wa,-Av9a -g -O2" ./configure But if Debian sparc needs to support pre-v9 sparcs, then I guess it would not be appropriate to use v9 instructions for urcu sparc build. Thoughts ? Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From sthibault at debian.org Fri Feb 22 09:30:32 2013 From: sthibault at debian.org (Samuel Thibault) Date: Fri, 22 Feb 2013 15:30:32 +0100 Subject: [lttng-dev] Package liburcu: build for hurd-i386 In-Reply-To: <20130222140920.GA22156@Krystal> References: <20130222140920.GA22156@Krystal> Message-ID: <20130222143032.GB8091@type.bordeaux.inria.fr> Hello, Mathieu Desnoyers, le Fri 22 Feb 2013 09:09:20 -0500, a ?crit : > I noticed a build failure on hurd-i386, and committed a fix in Userspace > RCU master branch to address this issue. Testing would be welcome. Unfortunately it doesn't work, because sched_setaffinity is for now just a fail-stub on hurd-i386, and thus configure considers it as missing, and thus the CPU_SET test is disabled completely. I however guess you could just disable defining your own cpu_set_t when !HAVE_SCHED_SETAFFINITY, since it is probably used only for using sched_setaffinity. Samuel From mathieu.desnoyers at efficios.com Fri Feb 22 11:01:12 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 22 Feb 2013 11:01:12 -0500 Subject: [lttng-dev] Package liburcu: build for hurd-i386 In-Reply-To: <20130222143032.GB8091@type.bordeaux.inria.fr> References: <20130222140920.GA22156@Krystal> <20130222143032.GB8091@type.bordeaux.inria.fr> Message-ID: <20130222160111.GA23609@Krystal> * Samuel Thibault (sthibault at debian.org) wrote: > Hello, > > Mathieu Desnoyers, le Fri 22 Feb 2013 09:09:20 -0500, a ?crit : > > I noticed a build failure on hurd-i386, and committed a fix in Userspace > > RCU master branch to address this issue. Testing would be welcome. > > Unfortunately it doesn't work, because sched_setaffinity is for now just > a fail-stub on hurd-i386, and thus configure considers it as missing, > and thus the CPU_SET test is disabled completely. > > I however guess you could just disable defining your own cpu_set_t when > !HAVE_SCHED_SETAFFINITY, since it is probably used only for using > sched_setaffinity. Either that or move the cpu_set_t, CPU_SET and CPU_ZERO tests outside of the sched_setaffinity conditional within configure.ac. It will allow to handle various configurations more elegantly. Here is the commit (pushed into master), comments are welcome! commit b3231c17e4a4e0b2d76754982eb1e1bc90da2987 Author: Mathieu Desnoyers Date: Fri Feb 22 10:57:48 2013 -0500 Fix hurd-i386: move cpuset tests outside of sched_setaffinity conditional Comment about introduction of cpuset.h within urcu tests: > Unfortunately it doesn't work, because sched_setaffinity is for now > just a fail-stub on hurd-i386, and thus configure considers it as > missing, and thus the CPU_SET test is disabled completely. > > I however guess you could just disable defining your own cpu_set_t > when !HAVE_SCHED_SETAFFINITY, since it is probably used only for using > sched_setaffinity. Fix by moving cpu_set_t, CPU_SET and CPU_ZERO tests outside of the sched_setaffinity conditional. Reported-by: Samuel Thibault Signed-off-by: Mathieu Desnoyers diff --git a/configure.ac b/configure.ac index a49b39f..b6f787b 100644 --- a/configure.ac +++ b/configure.ac @@ -202,6 +202,49 @@ AS_IF([test "x$def_smp_support" = "xyes"], [AC_DEFINE([CONFIG_RCU_SMP], [1])]) saved_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -D_GNU_SOURCE" +AC_CHECK_TYPES([cpu_set_t], + [have_cpu_set_t="yes"], + [have_cpu_set_t="no"], + [#include ]) + +# Confirm that we have CPU_ZERO, and it actually works. +AC_MSG_CHECKING([whether CPU_ZERO works]) +AH_TEMPLATE([HAVE_CPU_ZERO], [Defined to 1 if we have CPU_ZERO and it works]) +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ + #define _GNU_SOURCE + #include + int main() + { + cpu_set_t foo; CPU_ZERO(&foo); + return 0; + } + ]]) +],[ + AC_DEFINE(HAVE_CPU_ZERO, 1) + AC_MSG_RESULT([yes]) +],[ + AC_MSG_RESULT([no]) +]) + +# Confirm that we have CPU_SET, and it actually works. +AC_MSG_CHECKING([whether CPU_SET works]) +AH_TEMPLATE([HAVE_CPU_SET], [Defined to 1 if we have CPU_SET and it works]) +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ + #define _GNU_SOURCE + #include + int main() + { + cpu_set_t foo, mask; CPU_SET(0, &foo); + return 0; + } + ]]) +],[ + AC_DEFINE(HAVE_CPU_SET, 1) + AC_MSG_RESULT([yes]) +],[ + AC_MSG_RESULT([no]) +]) + # First check if the function is available at all. AC_CHECK_FUNCS([sched_setaffinity],[ # Okay, we have it. Check if also have cpu_set_t. If we don't, @@ -210,47 +253,8 @@ AC_CHECK_FUNCS([sched_setaffinity],[ # version with 2 or 3 arguments. In that case, CPU_ZERO, etc., # should also be present, but we confirm nonetheless. - AC_CHECK_TYPES([cpu_set_t],[ - # We do have it. Confirm that we have CPU_ZERO, and it actually works. - AC_MSG_CHECKING([whether CPU_ZERO works]) - AH_TEMPLATE([HAVE_CPU_ZERO], [Defined to 1 if we have CPU_ZERO and it works]) - AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ - #define _GNU_SOURCE - #include - int main() - { - cpu_set_t foo; CPU_ZERO (&foo); - return 0; - } - ]]) - ],[ - # Works! - AC_DEFINE(HAVE_CPU_ZERO, 1) - AC_MSG_RESULT([yes]) - ],[ - AC_MSG_RESULT([no]) - ]) - - # Confirm that we have CPU_SET, and it actually works. - AC_MSG_CHECKING([whether CPU_SET works]) - AH_TEMPLATE([HAVE_CPU_SET], [Defined to 1 if we have CPU_SET and it works]) - AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ - #define _GNU_SOURCE - #include - int main() - { - cpu_set_t foo, mask; CPU_SET (0, &foo); - return 0; - } - ]]) - ],[ - # Works! - AC_DEFINE(HAVE_CPU_SET, 1) - AC_MSG_RESULT([yes]) - ],[ - AC_MSG_RESULT([no]) - ]) - + AS_IF([test "x$have_cpu_set_t" = "xyes"], [ + # We do have it. # Check how many arguments does sched_setaffinity take. # Should be 3 or 2. AC_MSG_CHECKING([how many arguments sched_setaffinity takes]) @@ -259,21 +263,21 @@ AC_CHECK_FUNCS([sched_setaffinity],[ int main() { cpu_set_t foo; - sched_setaffinity (0, sizeof (foo), &foo); + sched_setaffinity(0, sizeof (foo), &foo); return 0; } ]]) ], [sched_set_affinity_args=3], [sched_set_affinity_args=2]) - AC_DEFINE_UNQUOTED(SCHED_SETAFFINITY_ARGS, $sched_set_affinity_args, + AC_DEFINE_UNQUOTED(SCHED_SETAFFINITY_ARGS, + $sched_set_affinity_args, [Defined to sched_setaffinity's number of arguments.]) AC_MSG_RESULT([$sched_set_affinity_args]) ],[ # No cpu_set_t, always 3 args. AC_DEFINE(SCHED_SETAFFINITY_ARGS, 3) - ], - [#include ]) + ]) ]) CFLAGS=$saved_CFLAGS -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From sthibault at debian.org Fri Feb 22 11:05:41 2013 From: sthibault at debian.org (Samuel Thibault) Date: Fri, 22 Feb 2013 17:05:41 +0100 Subject: [lttng-dev] Package liburcu: build for hurd-i386 In-Reply-To: <20130222160111.GA23609@Krystal> References: <20130222140920.GA22156@Krystal> <20130222143032.GB8091@type.bordeaux.inria.fr> <20130222160111.GA23609@Krystal> Message-ID: <20130222160541.GD8091@type.bordeaux.inria.fr> Mathieu Desnoyers, le Fri 22 Feb 2013 11:01:12 -0500, a ?crit : > * Samuel Thibault (sthibault at debian.org) wrote: > > Hello, > > > > Mathieu Desnoyers, le Fri 22 Feb 2013 09:09:20 -0500, a ?crit : > > > I noticed a build failure on hurd-i386, and committed a fix in Userspace > > > RCU master branch to address this issue. Testing would be welcome. > > > > Unfortunately it doesn't work, because sched_setaffinity is for now just > > a fail-stub on hurd-i386, and thus configure considers it as missing, > > and thus the CPU_SET test is disabled completely. > > > > I however guess you could just disable defining your own cpu_set_t when > > !HAVE_SCHED_SETAFFINITY, since it is probably used only for using > > sched_setaffinity. > > Either that or move the cpu_set_t, CPU_SET and CPU_ZERO tests outside of > the sched_setaffinity conditional within configure.ac. It will allow to > handle various configurations more elegantly. Here is the commit (pushed > into master), comments are welcome! Yep, it does build fine now. Samuel From mathieu.desnoyers at efficios.com Fri Feb 22 11:37:44 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 22 Feb 2013 11:37:44 -0500 Subject: [lttng-dev] Package liburcu: build for hurd-i386 In-Reply-To: <20130222160541.GD8091@type.bordeaux.inria.fr> References: <20130222140920.GA22156@Krystal> <20130222143032.GB8091@type.bordeaux.inria.fr> <20130222160111.GA23609@Krystal> <20130222160541.GD8091@type.bordeaux.inria.fr> Message-ID: <20130222163744.GA24196@Krystal> * Samuel Thibault (sthibault at debian.org) wrote: > Mathieu Desnoyers, le Fri 22 Feb 2013 11:01:12 -0500, a ?crit : > > * Samuel Thibault (sthibault at debian.org) wrote: > > > Hello, > > > > > > Mathieu Desnoyers, le Fri 22 Feb 2013 09:09:20 -0500, a ?crit : > > > > I noticed a build failure on hurd-i386, and committed a fix in Userspace > > > > RCU master branch to address this issue. Testing would be welcome. > > > > > > Unfortunately it doesn't work, because sched_setaffinity is for now just > > > a fail-stub on hurd-i386, and thus configure considers it as missing, > > > and thus the CPU_SET test is disabled completely. > > > > > > I however guess you could just disable defining your own cpu_set_t when > > > !HAVE_SCHED_SETAFFINITY, since it is probably used only for using > > > sched_setaffinity. > > > > Either that or move the cpu_set_t, CPU_SET and CPU_ZERO tests outside of > > the sched_setaffinity conditional within configure.ac. It will allow to > > handle various configurations more elegantly. Here is the commit (pushed > > into master), comments are welcome! > > Yep, it does build fine now. Thanks for testing! I noticed that tests/api.h also needed to use cpuset.h (committed a fix). I pulled these changes into stable-0.7. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From simon.marchi at polymtl.ca Fri Feb 22 14:23:41 2013 From: simon.marchi at polymtl.ca (Simon Marchi) Date: Fri, 22 Feb 2013 14:23:41 -0500 Subject: [lttng-dev] Babeltrace stable 1.0 branch Message-ID: This is a reminder of what we discussed on IRC a few days ago. It would be interesting to have a stable 1.0 branch of babeltrace so we can setup automatic builds of bt stable on launchpad. Thanks ! Simon From Daniel.Thibault at drdc-rddc.gc.ca Fri Feb 22 15:13:15 2013 From: Daniel.Thibault at drdc-rddc.gc.ca (Thibault, Daniel) Date: Fri, 22 Feb 2013 20:13:15 +0000 Subject: [lttng-dev] babeltrace omits its closing verbose comment Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD01C9AC@VAL-E-01.valcartier.drdc-rddc.gc.ca> The verbose output of babeltrace (-v, --verbose) is missing its closing comment. Looking at babeltrace.c, line 670: fmt_write->close_trace(td_write); bt_context_put(ctx); printf_verbose("finished converting. Output written to:\n%s\n", opt_output_path ? : ""); goto end; I suspect that the printf_verbose should be moved to *before* the fmt_write->close_trace. That way the last comment would be sent to stdout (or the user-selected --output, once bug 459 (http://bugs.lttng.org/issues/459) is fixed), right? Daniel U. Thibault R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) / Defence R&D Canada - Valcartier (DRDC Valcartier) Cyber s?curit? pour les missions essentielles (CME) / Mission Critical Cyber Security (MCCS) Protection des syst?mes et contremesures (PSC) / Systems Protection & Countermeasures (SPC) 2459 route de la Bravoure Qu?bec, QC? G3J 1X5 CANADA Vox?: (418) 844-4000 x4245 Fax?: (418) 844-4538 NAC?: 918V QSDJ Gouvernement du Canada?/ Government of Canada From mathieu.desnoyers at efficios.com Fri Feb 22 15:19:12 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 22 Feb 2013 15:19:12 -0500 Subject: [lttng-dev] Babeltrace stable 1.0 branch In-Reply-To: References: Message-ID: <20130222201912.GA25956@Krystal> * Simon Marchi (simon.marchi at polymtl.ca) wrote: > This is a reminder of what we discussed on IRC a few days ago. It > would be interesting to have a stable 1.0 branch of babeltrace so we > can setup automatic builds of bt stable on launchpad. Branch added, thanks! Mathieu > > Thanks ! > > Simon > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Fri Feb 22 15:28:19 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 22 Feb 2013 15:28:19 -0500 Subject: [lttng-dev] babeltrace omits its closing verbose comment In-Reply-To: <48CF5AC71E61DB46B70D0F388054EFFD01C9AC@VAL-E-01.valcartier.drdc-rddc.gc.ca> References: <48CF5AC71E61DB46B70D0F388054EFFD01C9AC@VAL-E-01.valcartier.drdc-rddc.gc.ca> Message-ID: <20130222202819.GB25956@Krystal> Good point, although the fix is not the one you proposed. See upstream commit: commit 9a3bb76ad636d5b5904e611ee8b4553d900a807c Author: Mathieu Desnoyers Date: Fri Feb 22 15:26:47 2013 -0500 Fix: ctf-text: don't close stdout Signed-off-by: Mathieu Desnoyers Thanks, Mathieu * Thibault, Daniel (Daniel.Thibault at drdc-rddc.gc.ca) wrote: > The verbose output of babeltrace (-v, --verbose) is missing its closing comment. Looking at babeltrace.c, line 670: > > fmt_write->close_trace(td_write); > > bt_context_put(ctx); > printf_verbose("finished converting. Output written to:\n%s\n", > opt_output_path ? : ""); > goto end; > > I suspect that the printf_verbose should be moved to *before* the fmt_write->close_trace. That way the last comment would be sent to stdout (or the user-selected --output, once bug 459 (http://bugs.lttng.org/issues/459) is fixed), right? > > Daniel U. Thibault > R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) / Defence R&D Canada - Valcartier (DRDC Valcartier) > Cyber s?curit? pour les missions essentielles (CME) / Mission Critical Cyber Security (MCCS) > Protection des syst?mes et contremesures (PSC) / Systems Protection & Countermeasures (SPC) > 2459 route de la Bravoure > Qu?bec, QC? G3J 1X5 > CANADA > Vox?: (418) 844-4000 x4245 > Fax?: (418) 844-4538 > NAC?: 918V QSDJ > Gouvernement du Canada?/ Government of Canada > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From baggett.patrick at gmail.com Fri Feb 22 15:42:31 2013 From: baggett.patrick at gmail.com (Patrick Baggett) Date: Fri, 22 Feb 2013 14:42:31 -0600 Subject: [lttng-dev] liburcu sparc support, build failure on buildd In-Reply-To: <20130222141551.GB22156@Krystal> References: <20130222141551.GB22156@Krystal> Message-ID: On Fri, Feb 22, 2013 at 8:15 AM, Mathieu Desnoyers < mathieu.desnoyers at efficios.com> wrote: > Hi, > > I notice the following build failure here > > https://buildd.debian.org/status/package.php?p=liburcu > > Tail of log for liburcu on sparc: > > urcu/static/wfqueue.h:84:2: warning: implicit declaration of function > 'CMM_STORE_SHARED' [-Wimplicit-function-declaration] > urcu/static/wfqueue.h: In function '___cds_wfq_node_sync_next': > urcu/static/wfqueue.h:99:2: warning: implicit declaration of function > 'CMM_LOAD_SHARED' [-Wimplicit-function-declaration] > urcu/static/wfqueue.h:99:15: warning: assignment makes pointer from > integer without a cast [enabled by default] > urcu/static/wfqueue.h:104:4: warning: implicit declaration of function > 'caa_cpu_relax' [-Wimplicit-function-declaration] > urcu/static/wfqueue.h: In function '___cds_wfq_dequeue_blocking': > urcu/static/wfqueue.h:126:55: warning: comparison between pointer and > integer [enabled by default] > make[3]: *** [wfqueue.lo] Error 1 > make[3]: Leaving directory > `/build/buildd-liburcu_0.7.6-1-sparc-GySyug/liburcu-0.7.6' > make[2]: *** [all-recursive] Error 1 > make[2]: Leaving directory > `/build/buildd-liburcu_0.7.6-1-sparc-GySyug/liburcu-0.7.6' > make[1]: *** [all] Error 2 > make[1]: Leaving directory > `/build/buildd-liburcu_0.7.6-1-sparc-GySyug/liburcu-0.7.6' > dh_auto_build: make -j1 returned exit code 2 > make: *** [build-arch] Error 2 > > One main question I have: what sparc architectures are supported by > Debian's "sparc" architecture ? Userspace RCU only supports Sparcv9 and > onward, because it requires some atomic instructions. > > Debian definitely only supports[1] SPARCv9 compatible CPUs (sun4u, sun4v). I've heard that Linux on 32-bit SPARC (i.e. sparc <= v8) is shoddy now, but I certainly haven't tried it. [1] http://www.debian.org/ports/sparc/ As documented in the urcu README file, building a package that includes > sparcv9 isntructions for 32-bit sparc can be done with: > > CFLAGS="-m32 -Wa,-Av9a -g -O2" ./configure > "v9a" includes VIS instruction set, which is an extension of SPARCv9. I think only some early Fujitsu SPARC CPUs (pre 2000) are missing it -- the original UltraSPARC from Sun does include it. Probably safe to turn on, but technically extends requirements to use the program. > > But if Debian sparc needs to support pre-v9 sparcs, then I guess it > would not be appropriate to use v9 instructions for urcu sparc build. > > Thoughts ? > > Thanks, > > Mathieu > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com > > > -- > To UNSUBSCRIBE, email to debian-sparc-REQUEST at lists.debian.org > with a subject of "unsubscribe". Trouble? Contact > listmaster at lists.debian.org > Archive: http://lists.debian.org/20130222141551.GB22156 at Krystal > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From thornton.richard at gmail.com Fri Feb 22 15:46:59 2013 From: thornton.richard at gmail.com (Richard Thornton) Date: Fri, 22 Feb 2013 15:46:59 -0500 Subject: [lttng-dev] liburcu sparc support, build failure on buildd In-Reply-To: References: <20130222141551.GB22156@Krystal> Message-ID: I support linux on x86 hardware, but on my old Sun blade 100, the only open source OS which consistently installs and runs properly is openbsd for sparc. I must have tried 100 times to get linux to work but it does not work with the rage xl video board and i am not a patient guy.; openbsd does. On Fri, Feb 22, 2013 at 3:42 PM, Patrick Baggett wrote: > > > On Fri, Feb 22, 2013 at 8:15 AM, Mathieu Desnoyers < > mathieu.desnoyers at efficios.com> wrote: > >> Hi, >> >> I notice the following build failure here >> >> https://buildd.debian.org/status/package.php?p=liburcu >> >> Tail of log for liburcu on sparc: >> >> urcu/static/wfqueue.h:84:2: warning: implicit declaration of function >> 'CMM_STORE_SHARED' [-Wimplicit-function-declaration] >> urcu/static/wfqueue.h: In function '___cds_wfq_node_sync_next': >> urcu/static/wfqueue.h:99:2: warning: implicit declaration of function >> 'CMM_LOAD_SHARED' [-Wimplicit-function-declaration] >> urcu/static/wfqueue.h:99:15: warning: assignment makes pointer from >> integer without a cast [enabled by default] >> urcu/static/wfqueue.h:104:4: warning: implicit declaration of function >> 'caa_cpu_relax' [-Wimplicit-function-declaration] >> urcu/static/wfqueue.h: In function '___cds_wfq_dequeue_blocking': >> urcu/static/wfqueue.h:126:55: warning: comparison between pointer and >> integer [enabled by default] >> make[3]: *** [wfqueue.lo] Error 1 >> make[3]: Leaving directory >> `/build/buildd-liburcu_0.7.6-1-sparc-GySyug/liburcu-0.7.6' >> make[2]: *** [all-recursive] Error 1 >> make[2]: Leaving directory >> `/build/buildd-liburcu_0.7.6-1-sparc-GySyug/liburcu-0.7.6' >> make[1]: *** [all] Error 2 >> make[1]: Leaving directory >> `/build/buildd-liburcu_0.7.6-1-sparc-GySyug/liburcu-0.7.6' >> dh_auto_build: make -j1 returned exit code 2 >> make: *** [build-arch] Error 2 >> >> One main question I have: what sparc architectures are supported by >> Debian's "sparc" architecture ? Userspace RCU only supports Sparcv9 and >> onward, because it requires some atomic instructions. >> >> > Debian definitely only supports[1] SPARCv9 compatible CPUs (sun4u, sun4v). > I've heard that Linux on 32-bit SPARC (i.e. sparc <= v8) is shoddy now, but > I certainly haven't tried it. > > [1] http://www.debian.org/ports/sparc/ > > As documented in the urcu README file, building a package that includes >> sparcv9 isntructions for 32-bit sparc can be done with: >> >> CFLAGS="-m32 -Wa,-Av9a -g -O2" ./configure >> > > "v9a" includes VIS instruction set, which is an extension of SPARCv9. I > think only some early Fujitsu SPARC CPUs (pre 2000) are missing it -- the > original UltraSPARC from Sun does include it. Probably safe to turn on, but > technically extends requirements to use the program. > > >> >> But if Debian sparc needs to support pre-v9 sparcs, then I guess it >> would not be appropriate to use v9 instructions for urcu sparc build. >> >> Thoughts ? >> >> Thanks, >> >> Mathieu >> >> -- >> Mathieu Desnoyers >> EfficiOS Inc. >> http://www.efficios.com >> >> >> -- >> To UNSUBSCRIBE, email to debian-sparc-REQUEST at lists.debian.org >> with a subject of "unsubscribe". Trouble? Contact >> listmaster at lists.debian.org >> Archive: http://lists.debian.org/20130222141551.GB22156 at Krystal >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian.babeux at efficios.com Fri Feb 22 16:27:59 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Fri, 22 Feb 2013 16:27:59 -0500 Subject: [lttng-dev] Pull request for lttng-tools tests cleanup branch Message-ID: Hello lttng-droids, Instead of spamming the mailing list with the 30+ patches for the lttng-tools tests cleanup branch, I would kindly ask for a pull request for commits 9ac429ef .. 0ea4ac57 on my personal repository. You can find the branch here: git://github.com/cbab/lttng-tools.git -b tests-cleanup Web: https://github.com/cbab/lttng-tools/commits/tests-cleanup Thanks, Christian From David.OShea at quantum.com Sun Feb 24 20:17:03 2013 From: David.OShea at quantum.com (David OShea) Date: Mon, 25 Feb 2013 01:17:03 +0000 Subject: [lttng-dev] Application freeze at startup with LTTng-UST and Perl dlopen() - TRACEPOINT_PROBE_DYNAMIC_LINKAGE? Message-ID: <20998D40D9A2B7499CA5A3A2666CB1EB19F97108@ZURMSG1.QUANTUM.com> Hi all, I'm getting freezes at application startup with LTTng-UST which I assume are due to my lack of understanding of TRACEPOINT_PROBE_DYNAMIC_LINKAGE. I'm running: - lttng-tools-2.0.4 - lttng-ust-2.0.5 patched with 009745db "Cache the procname per-thread rather than per-process to take into account that prctl() can be used to set thread names." and e699eda "don't spawn per-user thread if HOME is not set". - liburcu0-0.7.4-0 This is being run on CentOS 5.4. The lttng-ust man page says: """ BUILDING/LINKING THE TRACEPOINT PROVIDER [...] 1.1) Compile the Tracepoint provider with the application, either directly or through a static library (.a): [...] 2) Compile the Tracepoint Provider separately from the application, using dynamic linking: - Into exactly one object of your application: define "TRACEPOINT_DEFINE" _and_ also define "TRACEPOINT_PROBE_DYNAMIC_LINKAGE", then include the tracepoint provider header. [...] """ I have a dynamic library that includes code with tracepoint() calls, plus the relevant tracepoint definitions and trace providers - it is sort of "self-contained". My Perl script dlopen()s this dynamic library. Am I correct in thinking that this falls into option 2) above, because whilst the trace provider is statically linked with the code that uses the tracepoints, the trace provider is being dynamically linked into the application, and that is the part that matters to LTTng? When I build this dynamic library without TRACEPOINT_PROBE_DYNAMIC_LINKAGE #defined in the tracepoint definitions, I get a freeze that looks like https://bugs.lttng.org/issues/142 from the strace output: """ open("/usr/lib64/liburcu-common.so.1", O_RDONLY) = 4 read(4, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p\7`\0310\0\0\0"..., 832) = 832 fstat(4, {st_mode=S_IFREG|0755, st_size=9464, ...}) = 0 mmap(0x3019600000, 2102552, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0x3019600000 mprotect(0x3019602000, 2093056, PROT_NONE) = 0 mmap(0x3019801000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x1000) = 0x3019801000 close(4) = 0 mprotect(0x3fd3607000, 4096, PROT_READ) = 0 munmap(0x2ae2a2766000, 49028) = 0 open("/dev/urandom", O_RDONLY) = 4 fcntl(4, F_GETFD) = 0 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 getuid() = 0 getppid() = 8809 read(4, "\266\310we\347u\31\336\33\266 \262C\3267\32", 16) = 16 gettid() = 8810 clock_gettime(CLOCK_REALTIME, {1361753274, 392351000}) = 0 getuid() = 0 geteuid() = 0 rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0 mmap(NULL, 10489856, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_32BIT, -1, 0) = 0x4023d000 mprotect(0x4023d000, 4096, PROT_NONE) = 0 clone(child_stack=0x40c3d250, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x40c3d9d0, tls=0x40c3d940, child_tidptr=0x40c3d9d0) = 8811 mmap(NULL, 10489856, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_32BIT, -1, 0) = 0x41e43000 mprotect(0x41e43000, 4096, PROT_NONE) = 0 clone(child_stack=0x42843250, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x428439d0, tls=0x42843940, child_tidptr=0x428439d0) = 8812 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 futex(0x2ae2a29a5a80, FUTEX_WAIT_PRIVATE, 0, {2, 999506000}) = -1 ETIMEDOUT (Connection timed out) gettid() = 8810 write(2, "libust[8810/8810]: Error: Timed "..., 107libust[8810/8810]: Error: Timed out waiting for ltt-sessiond (in lttng_ust_init() at lttng-ust-comm.c:952) ) = 107 futex(0x2ae2a29a5b00, FUTEX_WAIT_PRIVATE, 2, NULL """ (freeze at this point) I realise that bug 142 is fixed in the version of the code I'm running. I also found that, even though the Perl script does not fork() (unless I'm very much mistaken), if I 'export LD_PRELOAD=/usr/lib64/liblttng-ust-fork.so.0' and then run a shell script that invokes 'perl ...' to start the script, the problem goes away. Is this because, when the shell fork()s to start Perl, liblttng-ust-fork.so.0 will cause LTTng to be initialised in the new process much earlier than is the case with just the dlopen()? I played around with another script and dynamic library combination and found a similar problem occurred on CentOS 5.4, but when I used the same LTTng-UST and related libraries on Fedora 16, I didn't get the freeze. Finally, I noticed that commit ID b834deadbfa8a78ae1d00440fd91c41dfd351eba changed README to remove a note suggesting that dlopen() not be used. It looks like the same change should be made to doc/man/lttng-ust.3, which still suggests that you not use dlopen(). Thanks in advance, David ---------------------------------------------------------------------- The information contained in this transmission may be confidential. Any disclosure, copying, or further distribution of confidential information is not permitted unless such privilege is explicitly granted in writing by Quantum. Quantum reserves the right to have electronic communications, including email and attachments, sent across its networks filtered through anti virus and spam software programs and retain such messages in order to comply with applicable data security and retention requirements. Quantum is not responsible for the proper and complete transmission of the substance of this communication or for any delay in its receipt. From Daniel.Thibault at drdc-rddc.gc.ca Mon Feb 25 13:50:36 2013 From: Daniel.Thibault at drdc-rddc.gc.ca (Thibault, Daniel) Date: Mon, 25 Feb 2013 18:50:36 +0000 Subject: [lttng-dev] babeltrace -i ? Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD01CF4B@VAL-E-01.valcartier.drdc-rddc.gc.ca> What is the babeltrace -i, --input-format option meant for? At first I thought one could round-trip a CTF trace to text and back using babeltrace, but if I try this: $ babeltrace /path_to_the/ctf_trace_directory -w /path_to_the/text_trace_file $ babeltrace /path_to_the/text_trace_file -i text -o ctf -w /path_to_the/reconstituted_ctf_trace_directory The second command gives me: [error] Cannot open any trace for reading. [error] opening trace "/path_to_the/text_trace_file" for reading. [error] none of the specified trace paths could be opened. If '-i ctf' is the only currently-implemented option, then we should get a more appropriate error message when using another: something along the lines of "babeltrace input format not supported ". Daniel U. Thibault R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) / Defence R&D Canada - Valcartier (DRDC Valcartier) Cyber s?curit? pour les missions essentielles (CME) / Mission Critical Cyber Security (MCCS) Protection des syst?mes et contremesures (PSC) / Systems Protection & Countermeasures (SPC) 2459 route de la Bravoure Qu?bec, QC? G3J 1X5 CANADA Vox?: (418) 844-4000 x4245 Fax?: (418) 844-4538 NAC?: 918V QSDJ Gouvernement du Canada?/ Government of Canada From dsmith at redhat.com Mon Feb 25 14:07:06 2013 From: dsmith at redhat.com (David Smith) Date: Mon, 25 Feb 2013 13:07:06 -0600 Subject: [lttng-dev] Using lttng-ust's libringbuffer outside lttng-ust In-Reply-To: References: <511A9E5A.4010303@redhat.com> Message-ID: <512BB65A.9060604@redhat.com> On 02/15/2013 02:36 PM, Christian Babeux wrote: > Hi David, Thanks for the response. >> The next question would be what is the best way of using libringbuffer >> outside lttng-ust. One (not great) possibility would be to just copy the >> code into systemtap. Of course the problem there is keeping the code up >> to date with changes in lttng-ust. The next possibility would be to make >> it a separate project (more like userspace-rcu). > > Splitting libringbuffer from the UST tree right now would prove to be > quite a challenge. We would need to expose an API to the "clients" of > the ringbuffer. Currently there are two levels of abstraction that one > can use with the ringbuffer: a "high-level" one where you use a > predefined "client" with the associated performance degradation and a > "low-level" one where you know exactly which kind of "client" you are > using with the associated fast-path inlined. > > We would need to discuss which level of abstraction we expose to the > user: a generic one or "N apis" for the different low-level "clients". In my head, I was planning on using the APIs defined in libringbuffer/*.h (like lib_ring_buffer_{reserve,commit,write} from frontend_api.h). But, perhaps we could back up a sec and you could describe a bit more the low-level vs. high-level levels of abstraction. Feel free to point me at some code. -- David Smith dsmith at redhat.com Red Hat http://www.redhat.com 256.217.0141 (direct) 256.837.0057 (fax) From yao at codesourcery.com Wed Feb 27 02:19:53 2013 From: yao at codesourcery.com (Yao Qi) Date: Wed, 27 Feb 2013 15:19:53 +0800 Subject: [lttng-dev] Iterate events in one packet Message-ID: <512DB399.6030807@codesourcery.com> Hi, When I generate CTF, I logically group events and put them into one packet. When reading the CTF data (w/ libbabeltrace), can I iterate over events in one packet (and stop when iterator goes to the next packet)? For example, stream { packet.context := struct { uint32_t content_size; uint32_t packet_size; }; event.header := struct { uint32_t id; }; }; event { name = "tsv"; id = 1; fields := struct { uint64_t val; uint32_t num; }; }; event { name = "register"; id = 0; fields := struct { uint8_t contents[440]; }; }; we have multiple events and put them into different packets according to my logic, packet 1: tsv1, register1, packet 2: tsv2, tsv3, register2 from iterator's point of view, packet boundary is invisible and iterator will go through them like "tsv1, register1, tsv2, tsv3, register2". In order to identify the boundary of packet in the iterator, I have to create a event "marker" and put it at the first event of one packet. event { name = "marker"; id = 2; fields := struct { }; }; packet 1: marker1, tsv1, register1, packet 2: marker2, tsv2, tsv3, register2 We'll stop the iteration once we see "marker" event. It works for me, but I am wondering we can solve this problem in a better way? -- Yao (??) From mathieu.desnoyers at efficios.com Wed Feb 27 07:23:47 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Wed, 27 Feb 2013 07:23:47 -0500 Subject: [lttng-dev] Iterate events in one packet In-Reply-To: <512DB399.6030807@codesourcery.com> References: <512DB399.6030807@codesourcery.com> Message-ID: <20130227122347.GA4252@Krystal> * Yao Qi (yao at codesourcery.com) wrote: > Hi, > When I generate CTF, I logically group events and put them into one > packet. When reading the CTF data (w/ libbabeltrace), can I iterate > over events in one packet (and stop when iterator goes to the next > packet)? I'm curious to see what you are trying to achieve by grouping events this way ? You know you could simply put each logical event group into a different "channel" within the same trace, right ? The level of abstraction at which the babeltrace iterator presents the trace does not expose details about packet switching. I'd need more information to understand the value of your use-case. Thanks, Mathieu > > For example, > > stream { > packet.context := struct { > uint32_t content_size; > uint32_t packet_size; > }; > event.header := struct { > uint32_t id; > }; > }; > > event { > name = "tsv"; > id = 1; > fields := struct { > uint64_t val; > uint32_t num; > }; > }; > > event { > name = "register"; > id = 0; > fields := struct { > uint8_t contents[440]; > }; > }; > > we have multiple events and put them into different packets according to > my logic, > > packet 1: tsv1, register1, > packet 2: tsv2, tsv3, register2 > > from iterator's point of view, packet boundary is invisible and iterator > will go through them like "tsv1, register1, tsv2, tsv3, register2". In > order to identify the boundary of packet in the iterator, I have to > create a event "marker" and put it at the first event of one packet. > > event { > name = "marker"; > id = 2; > fields := struct { > }; > }; > > packet 1: marker1, tsv1, register1, > packet 2: marker2, tsv2, tsv3, register2 > > We'll stop the iteration once we see "marker" event. It works for me, > but I am wondering we can solve this problem in a better way? > > -- > Yao (??) > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From yao at codesourcery.com Wed Feb 27 07:53:13 2013 From: yao at codesourcery.com (Yao Qi) Date: Wed, 27 Feb 2013 20:53:13 +0800 Subject: [lttng-dev] Iterate events in one packet In-Reply-To: <20130227122347.GA4252@Krystal> References: <512DB399.6030807@codesourcery.com> <20130227122347.GA4252@Krystal> Message-ID: <512E01B9.8070007@codesourcery.com> On 02/27/2013 08:23 PM, Mathieu Desnoyers wrote: > I'm curious to see what you are trying to achieve by grouping events > this way ? We propose to GDB community to save GDB trace data into CTF and read CTF data saved by GDB (via libbabeltrace). [PATCH 0/5, 2nd try] CTF Support http://sourceware.org/ml/gdb-patches/2013-02/msg00669.html The GDB trace data is composed by several trace frames, and each trace frame is composed by several blocks. When saving GDB trace data into CTF, we save the block as ctf event, and save these events belong to the same trace frame into one packet, so that the information of the trace frame can be saved into packet context. When reading CTF data, usually we will look for events in current trace frame (packet), so that I am asking this question, to see if it is easier to do iteration in one packet. > > You know you could simply put each logical event group into a different > "channel" within the same trace, right ? Can you elaborate a little please? I am quite new to CTF and babeltrace. > > The level of abstraction at which the babeltrace iterator presents the > trace does not expose details about packet switching. I'd need more > information to understand the value of your use-case. Hope my description above is clear. -- Yao (??) From mathieu.desnoyers at efficios.com Wed Feb 27 10:15:35 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Wed, 27 Feb 2013 10:15:35 -0500 Subject: [lttng-dev] Iterate events in one packet In-Reply-To: <512E01B9.8070007@codesourcery.com> References: <512DB399.6030807@codesourcery.com> <20130227122347.GA4252@Krystal> <512E01B9.8070007@codesourcery.com> Message-ID: <20130227151535.GB860@Krystal> * Yao Qi (yao at codesourcery.com) wrote: > On 02/27/2013 08:23 PM, Mathieu Desnoyers wrote: >> I'm curious to see what you are trying to achieve by grouping events >> this way ? > > We propose to GDB community to save GDB trace data into CTF and read CTF > data saved by GDB (via libbabeltrace). > > [PATCH 0/5, 2nd try] CTF Support > http://sourceware.org/ml/gdb-patches/2013-02/msg00669.html > > The GDB trace data is composed by several trace frames, and each trace > frame is composed by several blocks. When saving GDB trace data into > CTF, we save the block as ctf event, and save these events belong to the > same trace frame into one packet, so that the information of the trace > frame can be saved into packet context. > > When reading CTF data, usually we will look for events in current trace > frame (packet), so that I am asking this question, to see if it is > easier to do iteration in one packet. You might want to consider an alternative design: consider this mapping instead: one event = one trace frame the event "payload" would be a sequence of blocks. Each block can contain its own information. You could use the "variant" type if you need different types for each block within a trace frame. This would fit more nicely with CTF. Thanks, Mathieu > >> >> You know you could simply put each logical event group into a different >> "channel" within the same trace, right ? > > Can you elaborate a little please? I am quite new to CTF and babeltrace. > >> >> The level of abstraction at which the babeltrace iterator presents the >> trace does not expose details about packet switching. I'd need more >> information to understand the value of your use-case. > > Hope my description above is clear. > > -- > Yao (??) -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From Daniel.Thibault at drdc-rddc.gc.ca Wed Feb 27 17:02:50 2013 From: Daniel.Thibault at drdc-rddc.gc.ca (Thibault, Daniel) Date: Wed, 27 Feb 2013 22:02:50 +0000 Subject: [lttng-dev] babeltrace local time? Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD01D433@VAL-E-01.valcartier.drdc-rddc.gc.ca> When babeltrace prints out timestamps in "local time" (the default), is that the trace's local time (i.e. the local time of the system that was traced) or is it the local time of the system running babeltrace? I suspect the former but I want to be sure. Daniel U. Thibault R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) / Defence R&D Canada - Valcartier (DRDC Valcartier) Cyber s?curit? pour les missions essentielles (CME) / Mission Critical Cyber Security (MCCS) Protection des syst?mes et contremesures (PSC) / Systems Protection & Countermeasures (SPC) 2459 route de la Bravoure Qu?bec, QC? G3J 1X5 CANADA Vox?: (418) 844-4000 x4245 Fax?: (418) 844-4538 NAC?: 918V QSDJ Gouvernement du Canada?/ Government of Canada From jp_ikaheimonen at mentor.com Thu Feb 28 02:46:08 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Thu, 28 Feb 2013 07:46:08 +0000 Subject: [lttng-dev] Babeltrace for MINGW32 Message-ID: <009B25148989C6458484484699278506985C19C1@EU-MBX-01.mgc.mentorg.com> Hi, I am interested in building a statically linked 32-bit Windows executable of babeltrace. For that purpose, I have taken a shot at building babeltrace 1.0.3 with MinGW. As for now, I've managed to build the main executable, which is all I'm interested about. Babeltrace-log and the test suite will not build right now. MinGW is missing many library functions that babeltrace uses. I have written replacements for many of these. The replacement functions are not fully compliant with the original specifications, but they work well enough under babeltrace. This required some changed in the configure.ac file as well, so that my versions of uuid, fmemopen and open_memstream are correctly detected. Occasionally, I have had to make changes to the babeltrace source code. As an example, MinGW cannot use directory file handles in any meaningful way, so functions such as openat() and dirfd() are out of the question. I have circumvented these problems by using open() instead of openat(). Also, MinGW seems to have a problem using pthread mutexes in a statically linked executable, so I'm just not using the float_mutex at all. I do not think that's a problem for me, as I'm using babeltrace as a single-threaded executable instead of a library. I have flagged all source code changes with #ifdef __MINGW32__ . Would these changes be of interest to the babeltrace community? How likely would they be accepted into the main sources? Thank you, JP Ikaheimonen Mentor Graphics Embedded Systems Division Nucleus(r) | Linux(r) | Android(tm) | Services | UI | Multi-OS Android is a trademark of Google Inc. Use of this trademark is subject to Google Permissions. Linux is the registered trademark of Linus Torvalds in the U.S. and other countries. From mathieu.desnoyers at efficios.com Thu Feb 28 07:50:43 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 28 Feb 2013 07:50:43 -0500 Subject: [lttng-dev] Babeltrace for MINGW32 In-Reply-To: <009B25148989C6458484484699278506985C19C1@EU-MBX-01.mgc.mentorg.com> References: <009B25148989C6458484484699278506985C19C1@EU-MBX-01.mgc.mentorg.com> Message-ID: <20130228125043.GA25431@Krystal> * Ikaheimonen, JP (jp_ikaheimonen at mentor.com) wrote: > Hi, > > I am interested in building a statically linked 32-bit Windows > executable of babeltrace. For that purpose, I have taken a shot at > building babeltrace 1.0.3 with MinGW. As for now, I've managed to > build the main executable, which is all I'm interested about. > Babeltrace-log and the test suite will not build right now. > > MinGW is missing many library functions that babeltrace uses. I have > written replacements for many of these. The replacement functions are > not fully compliant with the original specifications, but they work > well enough under babeltrace. This required some changed in the > configure.ac file as well, so that my versions of uuid, fmemopen and > open_memstream are correctly detected. Hopefully you use babeltrace master formats/ctf/memstream.h for fmemopen and open_memstream, and include/babeltrace/uuid.h. > > Occasionally, I have had to make changes to the babeltrace source > code. As an example, MinGW cannot use directory file handles in any > meaningful way, so functions such as openat() and dirfd() are out of > the question. I have circumvented these problems by using open() > instead of openat(). Also, MinGW seems to have a problem using pthread > mutexes in a statically linked executable, so I'm just not using the > float_mutex at all. I do not think that's a problem for me, as I'm > using babeltrace as a single-threaded executable instead of a library. > > I have flagged all source code changes with #ifdef __MINGW32__ . > > Would these changes be of interest to the babeltrace community? How > likely would they be accepted into the main sources? In pretty much all lttng-related user-space projects, we have a "compat/" directory that contains compatibility wrappers (for kernel-related projects like lttng-modules, we call it "wrapper"). Please have a look at lttng-tools src/common/compat for examples. Adding one to babeltrace seems like the way to go. We already have wrappers like this under formats/ctf/memstream.h and include/babeltrace/uuid.h in the babeltrace project. As we add more compatibility layer headers, it would be good to move them all into the same location. This allows us to move the complexity of supporting multiple environments into localized files. Therefore, as a general rule, I don't want to see any #ifdef __MINGW32__ anywhere but within compat/ files. If you need to change behavior specifically for mingw (or any architecture), you will need to create a compatibility layer that hides this from the generic code under a simple function call (or static inline). Thanks, Mathieu > > Thank you, > > JP Ikaheimonen > Mentor Graphics Embedded Systems Division > Nucleus(r) | Linux(r) | Android(tm) | Services | UI | Multi-OS > > Android is a trademark of Google Inc. Use of this trademark is subject to Google Permissions. > Linux is the registered trademark of Linus Torvalds in the U.S. and other countries. > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Thu Feb 28 07:55:49 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 28 Feb 2013 07:55:49 -0500 Subject: [lttng-dev] Babeltrace for MINGW32 In-Reply-To: <20130228125043.GA25431@Krystal> References: <009B25148989C6458484484699278506985C19C1@EU-MBX-01.mgc.mentorg.com> <20130228125043.GA25431@Krystal> Message-ID: <20130228125549.GA25674@Krystal> * Mathieu Desnoyers (mathieu.desnoyers at efficios.com) wrote: > * Ikaheimonen, JP (jp_ikaheimonen at mentor.com) wrote: > > Hi, > > > > I am interested in building a statically linked 32-bit Windows > > executable of babeltrace. For that purpose, I have taken a shot at > > building babeltrace 1.0.3 with MinGW. As for now, I've managed to > > build the main executable, which is all I'm interested about. > > Babeltrace-log and the test suite will not build right now. > > > > MinGW is missing many library functions that babeltrace uses. I have > > written replacements for many of these. The replacement functions are > > not fully compliant with the original specifications, but they work > > well enough under babeltrace. This required some changed in the > > configure.ac file as well, so that my versions of uuid, fmemopen and > > open_memstream are correctly detected. > > Hopefully you use babeltrace master formats/ctf/memstream.h for fmemopen > and open_memstream, and include/babeltrace/uuid.h. > > > > > Occasionally, I have had to make changes to the babeltrace source > > code. As an example, MinGW cannot use directory file handles in any > > meaningful way, so functions such as openat() and dirfd() are out of > > the question. I have circumvented these problems by using open() > > instead of openat(). Also, MinGW seems to have a problem using pthread > > mutexes in a statically linked executable, so I'm just not using the > > float_mutex at all. I do not think that's a problem for me, as I'm > > using babeltrace as a single-threaded executable instead of a library. By the way, it would be good to find a way to get this mutex to work. It's the only mutex needed to make babeltrace a fully reentrant library, and I'd like to keep it that way. In the long run, it's probably easier to fix that to document and explain the limitation, Thanks, Mathieu > > > > I have flagged all source code changes with #ifdef __MINGW32__ . > > > > Would these changes be of interest to the babeltrace community? How > > likely would they be accepted into the main sources? > > In pretty much all lttng-related user-space projects, we have a > "compat/" directory that contains compatibility wrappers (for > kernel-related projects like lttng-modules, we call it "wrapper"). > Please have a look at lttng-tools src/common/compat for examples. Adding > one to babeltrace seems like the way to go. > > We already have wrappers like this under formats/ctf/memstream.h and > include/babeltrace/uuid.h in the babeltrace project. As we add more > compatibility layer headers, it would be good to move them all into the > same location. > > This allows us to move the complexity of supporting multiple > environments into localized files. Therefore, as a general rule, I don't > want to see any #ifdef __MINGW32__ anywhere but within compat/ files. If > you need to change behavior specifically for mingw (or any > architecture), you will need to create a compatibility layer that hides > this from the generic code under a simple function call (or static > inline). > > Thanks, > > Mathieu > > > > > Thank you, > > > > JP Ikaheimonen > > Mentor Graphics Embedded Systems Division > > Nucleus(r) | Linux(r) | Android(tm) | Services | UI | Multi-OS > > > > Android is a trademark of Google Inc. Use of this trademark is subject to Google Permissions. > > Linux is the registered trademark of Linus Torvalds in the U.S. and other countries. > > > > > > _______________________________________________ > > lttng-dev mailing list > > lttng-dev at lists.lttng.org > > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From jp_ikaheimonen at mentor.com Thu Feb 28 08:39:10 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Thu, 28 Feb 2013 13:39:10 +0000 Subject: [lttng-dev] Babeltrace for MINGW32 In-Reply-To: <20130228125549.GA25674@Krystal> References: <009B25148989C6458484484699278506985C19C1@EU-MBX-01.mgc.mentorg.com> <20130228125043.GA25431@Krystal> <20130228125549.GA25674@Krystal> Message-ID: <009B25148989C6458484484699278506985C1A53@EU-MBX-01.mgc.mentorg.com> Thank you Mathieu for your prompt answer, I will keep these guidelines in mind. JP Ikaheimonen Mentor Graphics Embedded Systems Division Nucleus(r) | Linux(r) | Android(tm) | Services | UI | Multi-OS Android is a trademark of Google Inc. Use of this trademark is subject to Google Permissions. Linux is the registered trademark of Linus Torvalds in the U.S. and other countries. -----Original Message----- From: Mathieu Desnoyers [mailto:mathieu.desnoyers at efficios.com] Sent: 28. helmikuuta 2013 14:56 To: Ikaheimonen, JP Cc: lttng-dev at lists.lttng.org Subject: Re: [lttng-dev] Babeltrace for MINGW32 * Mathieu Desnoyers (mathieu.desnoyers at efficios.com) wrote: > * Ikaheimonen, JP (jp_ikaheimonen at mentor.com) wrote: > > Hi, > > > > I am interested in building a statically linked 32-bit Windows > > executable of babeltrace. For that purpose, I have taken a shot at > > building babeltrace 1.0.3 with MinGW. As for now, I've managed to > > build the main executable, which is all I'm interested about. > > Babeltrace-log and the test suite will not build right now. > > > > MinGW is missing many library functions that babeltrace uses. I have > > written replacements for many of these. The replacement functions > > are not fully compliant with the original specifications, but they > > work well enough under babeltrace. This required some changed in the > > configure.ac file as well, so that my versions of uuid, fmemopen and > > open_memstream are correctly detected. > > Hopefully you use babeltrace master formats/ctf/memstream.h for > fmemopen and open_memstream, and include/babeltrace/uuid.h. > > > > > Occasionally, I have had to make changes to the babeltrace source > > code. As an example, MinGW cannot use directory file handles in any > > meaningful way, so functions such as openat() and dirfd() are out of > > the question. I have circumvented these problems by using open() > > instead of openat(). Also, MinGW seems to have a problem using > > pthread mutexes in a statically linked executable, so I'm just not > > using the float_mutex at all. I do not think that's a problem for > > me, as I'm using babeltrace as a single-threaded executable instead of a library. By the way, it would be good to find a way to get this mutex to work. It's the only mutex needed to make babeltrace a fully reentrant library, and I'd like to keep it that way. In the long run, it's probably easier to fix that to document and explain the limitation, Thanks, Mathieu > > > > I have flagged all source code changes with #ifdef __MINGW32__ . > > > > Would these changes be of interest to the babeltrace community? How > > likely would they be accepted into the main sources? > > In pretty much all lttng-related user-space projects, we have a > "compat/" directory that contains compatibility wrappers (for > kernel-related projects like lttng-modules, we call it "wrapper"). > Please have a look at lttng-tools src/common/compat for examples. > Adding one to babeltrace seems like the way to go. > > We already have wrappers like this under formats/ctf/memstream.h and > include/babeltrace/uuid.h in the babeltrace project. As we add more > compatibility layer headers, it would be good to move them all into > the same location. > > This allows us to move the complexity of supporting multiple > environments into localized files. Therefore, as a general rule, I > don't want to see any #ifdef __MINGW32__ anywhere but within compat/ > files. If you need to change behavior specifically for mingw (or any > architecture), you will need to create a compatibility layer that > hides this from the generic code under a simple function call (or > static inline). > > Thanks, > > Mathieu > > > > > Thank you, > > > > JP Ikaheimonen > > Mentor Graphics Embedded Systems Division > > Nucleus(r) | Linux(r) | Android(tm) | Services | UI | Multi-OS > > > > Android is a trademark of Google Inc. Use of this trademark is subject to Google Permissions. > > Linux is the registered trademark of Linus Torvalds in the U.S. and other countries. > > > > > > _______________________________________________ > > lttng-dev mailing list > > lttng-dev at lists.lttng.org > > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From christian.babeux at efficios.com Thu Feb 28 15:48:24 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Thu, 28 Feb 2013 15:48:24 -0500 Subject: [lttng-dev] [PATCH lttng-tools] Fix: Memory leak on error paths of relay_add_stream Message-ID: <1362084510-10072-1-git-send-email-christian.babeux@efficios.com> On error paths the memory allocated for stream is never freed. Also, fix undefined behavior on asprintf alloc failure. According to asprintf(3), the content of the pointer passed to it is undefined if an alloc failure occurs, so we could end up freeing a pointer in an undefined state. Force its value to NULL. Signed-off-by: Christian Babeux --- src/bin/lttng-relayd/main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c index 4f9d742..00b7ea3 100644 --- a/src/bin/lttng-relayd/main.c +++ b/src/bin/lttng-relayd/main.c @@ -941,6 +941,7 @@ int relay_add_stream(struct lttcomm_relayd_hdr *recv_hdr, ret = asprintf(&path, "%s/%s", root_path, stream_info.channel_name); if (ret < 0) { PERROR("asprintf stream path"); + path = NULL; goto end; } @@ -963,13 +964,17 @@ int relay_add_stream(struct lttcomm_relayd_hdr *recv_hdr, end: free(path); free(root_path); + + reply.handle = htobe64(stream->stream_handle); /* send the session id to the client or a negative return code on error */ if (ret < 0) { reply.ret_code = htobe32(LTTNG_ERR_UNK); + /* stream was not properly added to the ht, so free it */ + free(stream); } else { reply.ret_code = htobe32(LTTNG_OK); } - reply.handle = htobe64(stream->stream_handle); + send_ret = cmd->sock->ops->sendmsg(cmd->sock, &reply, sizeof(struct lttcomm_relayd_status_stream), 0); if (send_ret < 0) { -- 1.8.1.3 From christian.babeux at efficios.com Thu Feb 28 15:48:25 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Thu, 28 Feb 2013 15:48:25 -0500 Subject: [lttng-dev] [PATCH lttng-tools] Fix: Memory leaks on error paths in config_read_session_name In-Reply-To: <1362084510-10072-1-git-send-email-christian.babeux@efficios.com> References: <1362084510-10072-1-git-send-email-christian.babeux@efficios.com> Message-ID: <1362084510-10072-2-git-send-email-christian.babeux@efficios.com> Signed-off-by: Christian Babeux --- src/bin/lttng/conf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bin/lttng/conf.c b/src/bin/lttng/conf.c index c1bfcfd..7439c1c 100644 --- a/src/bin/lttng/conf.c +++ b/src/bin/lttng/conf.c @@ -203,6 +203,7 @@ char *config_read_session_name(char *path) if (fp == NULL) { ERR("Can't find valid lttng config %s/.lttngrc", path); MSG("Did you create a session? (lttng create )"); + free(session_name); goto error; } @@ -221,6 +222,7 @@ char *config_read_session_name(char *path) } error_close: + free(session_name); ret = fclose(fp); if (ret < 0) { PERROR("close config read session name"); -- 1.8.1.3 From christian.babeux at efficios.com Thu Feb 28 15:48:26 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Thu, 28 Feb 2013 15:48:26 -0500 Subject: [lttng-dev] [PATCH lttng-tools] Fix: Memory leaks on error paths when exporting consumerd libdir in env In-Reply-To: <1362084510-10072-1-git-send-email-christian.babeux@efficios.com> References: <1362084510-10072-1-git-send-email-christian.babeux@efficios.com> Message-ID: <1362084510-10072-3-git-send-email-christian.babeux@efficios.com> Signed-off-by: Christian Babeux --- src/bin/lttng-sessiond/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index e9529f1..82f0a84 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -1798,6 +1798,7 @@ static pid_t spawn_consumerd(struct consumer_data *consumer_data) ret = putenv(tmpnew); if (ret) { ret = -errno; + free(tmpnew); goto error; } } @@ -1842,6 +1843,7 @@ static pid_t spawn_consumerd(struct consumer_data *consumer_data) ret = putenv(tmpnew); if (ret) { ret = -errno; + free(tmpnew); goto error; } } -- 1.8.1.3 From christian.babeux at efficios.com Thu Feb 28 15:48:27 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Thu, 28 Feb 2013 15:48:27 -0500 Subject: [lttng-dev] [PATCH lttng-tools] Fix: Memory leaks on unknown hashtable type error handling In-Reply-To: <1362084510-10072-1-git-send-email-christian.babeux@efficios.com> References: <1362084510-10072-1-git-send-email-christian.babeux@efficios.com> Message-ID: <1362084510-10072-4-git-send-email-christian.babeux@efficios.com> Signed-off-by: Christian Babeux --- src/common/hashtable/hashtable.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/hashtable/hashtable.c b/src/common/hashtable/hashtable.c index 24d5797..5bf85e5 100644 --- a/src/common/hashtable/hashtable.c +++ b/src/common/hashtable/hashtable.c @@ -90,6 +90,7 @@ struct lttng_ht *lttng_ht_new(unsigned long size, int type) break; default: ERR("Unknown lttng hashtable type %d", type); + lttng_ht_destroy(ht); goto error; } -- 1.8.1.3 From christian.babeux at efficios.com Thu Feb 28 15:48:28 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Thu, 28 Feb 2013 15:48:28 -0500 Subject: [lttng-dev] [PATCH lttng-tools] Fix: Memory leaks when calling get_cmdline_by_pid In-Reply-To: <1362084510-10072-1-git-send-email-christian.babeux@efficios.com> References: <1362084510-10072-1-git-send-email-christian.babeux@efficios.com> Message-ID: <1362084510-10072-5-git-send-email-christian.babeux@efficios.com> Callers of get_cmdline_by_pid must free(3) the returned string. Signed-off-by: Christian Babeux --- src/bin/lttng/commands/list.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/bin/lttng/commands/list.c b/src/bin/lttng/commands/list.c index 8fec91f..5429df4 100644 --- a/src/bin/lttng/commands/list.c +++ b/src/bin/lttng/commands/list.c @@ -294,6 +294,7 @@ static int list_ust_events(void) struct lttng_handle *handle; struct lttng_event *event_list; pid_t cur_pid = 0; + char *cmdline = NULL; memset(&domain, 0, sizeof(domain)); @@ -322,7 +323,9 @@ static int list_ust_events(void) for (i = 0; i < size; i++) { if (cur_pid != event_list[i].pid) { cur_pid = event_list[i].pid; - MSG("\nPID: %d - Name: %s", cur_pid, get_cmdline_by_pid(cur_pid)); + cmdline = get_cmdline_by_pid(cur_pid); + MSG("\nPID: %d - Name: %s", cur_pid, cmdline); + free(cmdline); } print_events(&event_list[i]); } @@ -349,6 +352,8 @@ static int list_ust_event_fields(void) struct lttng_handle *handle; struct lttng_event_field *event_field_list; pid_t cur_pid = 0; + char *cmdline = NULL; + struct lttng_event cur_event; memset(&domain, 0, sizeof(domain)); @@ -379,7 +384,9 @@ static int list_ust_event_fields(void) for (i = 0; i < size; i++) { if (cur_pid != event_field_list[i].event.pid) { cur_pid = event_field_list[i].event.pid; - MSG("\nPID: %d - Name: %s", cur_pid, get_cmdline_by_pid(cur_pid)); + cmdline = get_cmdline_by_pid(cur_pid); + MSG("\nPID: %d - Name: %s", cur_pid, cmdline); + free(cmdline); } if (strcmp(cur_event.name, event_field_list[i].event.name) != 0) { print_events(&event_field_list[i].event); -- 1.8.1.3 From christian.babeux at efficios.com Thu Feb 28 15:48:29 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Thu, 28 Feb 2013 15:48:29 -0500 Subject: [lttng-dev] [PATCH lttng-tools] Fix: Memory leak when zmalloc fail on kernel channel allocation In-Reply-To: <1362084510-10072-1-git-send-email-christian.babeux@efficios.com> References: <1362084510-10072-1-git-send-email-christian.babeux@efficios.com> Message-ID: <1362084510-10072-6-git-send-email-christian.babeux@efficios.com> Signed-off-by: Christian Babeux --- src/bin/lttng-sessiond/trace-kernel.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bin/lttng-sessiond/trace-kernel.c b/src/bin/lttng-sessiond/trace-kernel.c index 48be065..8839a00 100644 --- a/src/bin/lttng-sessiond/trace-kernel.c +++ b/src/bin/lttng-sessiond/trace-kernel.c @@ -158,6 +158,7 @@ struct ltt_kernel_channel *trace_kernel_create_channel( lkc->channel = zmalloc(sizeof(struct lttng_channel)); if (lkc->channel == NULL) { PERROR("lttng_channel zmalloc"); + free(lkc); goto error; } memcpy(lkc->channel, chan, sizeof(struct lttng_channel)); -- 1.8.1.3 From christian.babeux at efficios.com Thu Feb 28 15:48:30 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Thu, 28 Feb 2013 15:48:30 -0500 Subject: [lttng-dev] [PATCH lttng-tools] Fix: Use after free on spawn_sessiond error path in check_sessiond In-Reply-To: <1362084510-10072-1-git-send-email-christian.babeux@efficios.com> References: <1362084510-10072-1-git-send-email-christian.babeux@efficios.com> Message-ID: <1362084510-10072-7-git-send-email-christian.babeux@efficios.com> Signed-off-by: Christian Babeux --- src/bin/lttng/lttng.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/bin/lttng/lttng.c b/src/bin/lttng/lttng.c index 8562144..be673f9 100644 --- a/src/bin/lttng/lttng.c +++ b/src/bin/lttng/lttng.c @@ -374,13 +374,12 @@ static int check_sessiond(void) } ret = spawn_sessiond(pathname); - free(alloc_pathname); if (ret < 0) { ERR("Problem occurred when starting %s", pathname); - goto end; } - } + free(alloc_pathname); + } end: return ret; } -- 1.8.1.3 From christian.babeux at efficios.com Thu Feb 28 15:51:48 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Thu, 28 Feb 2013 15:51:48 -0500 Subject: [lttng-dev] [PATCH babeltrace] Fix: Undefined behavior of double free on strlist in get_names_args Message-ID: <1362084708-10329-1-git-send-email-christian.babeux@efficios.com> Signed-off-by: Christian Babeux --- converter/babeltrace.c | 1 + 1 file changed, 1 insertion(+) diff --git a/converter/babeltrace.c b/converter/babeltrace.c index 20ded00..28c63cb 100644 --- a/converter/babeltrace.c +++ b/converter/babeltrace.c @@ -205,6 +205,7 @@ static int get_names_args(poptContext *pc) } else { fprintf(stderr, "[error] unknown field name type %s\n", str); free(strlist); + strlist = NULL; ret = -EINVAL; goto end; } -- 1.8.1.3 From Daniel.Thibault at drdc-rddc.gc.ca Thu Feb 28 16:08:17 2013 From: Daniel.Thibault at drdc-rddc.gc.ca (Thibault, Daniel) Date: Thu, 28 Feb 2013 21:08:17 +0000 Subject: [lttng-dev] babeltrace omits its closing verbose comment Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD021BDC@VAL-E-01.valcartier.drdc-rddc.gc.ca> ---------------------------------------------------------------------- Message: 1 Date: Fri, 22 Feb 2013 20:13:15 +0000 From: "Thibault, Daniel" Subject: [lttng-dev] babeltrace omits its closing verbose comment > The verbose output of babeltrace (-v, --verbose) is missing its closing comment. Looking at babeltrace.c, line 670: > > fmt_write->close_trace(td_write); > > bt_context_put(ctx); > printf_verbose("finished converting. Output written to:\n%s\n", > opt_output_path ? : ""); > goto end; > > I suspect that the printf_verbose should be moved to *before* the fmt_write->close_trace. That way the last comment would be sent to stdout > (or the user-selected --output, once bug 459 (http://bugs.lttng.org/issues/459) is fixed), right? Revisiting this, I see I was wrong in wanting the closing comment pushed to stdout: it correctly belongs on stderr, like the '[verbose]' prologue to the babeltrace conversion. My mistake was caused by using 'babeltrace sometrace -v &> outputtrace' in order to circumvent the (now fixed) -w bug (I should have used just '>'). This made me miss the distinction between what verbose pushes to stderr vs. what it pushes to stdout (or -w). Quite correctly, --verbose changes only one thing in the output: it adds the stream.event.header to the event records. Daniel U. Thibault R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) / Defence R&D Canada - Valcartier (DRDC Valcartier) Cyber s?curit? pour les missions essentielles (CME) / Mission Critical Cyber Security (MCCS) Protection des syst?mes et contremesures (PSC) / Systems Protection & Countermeasures (SPC) 2459 route de la Bravoure Qu?bec, QC G3J 1X5 CANADA Vox : (418) 844-4000 x4245 Fax : (418) 844-4538 NAC : 918V QSDJ Gouvernement du Canada / Government of Canada From mathieu.desnoyers at efficios.com Thu Feb 28 17:54:29 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 28 Feb 2013 17:54:29 -0500 Subject: [lttng-dev] [PATCH babeltrace] Fix: Undefined behavior of double free on strlist in get_names_args In-Reply-To: <1362084708-10329-1-git-send-email-christian.babeux@efficios.com> References: <1362084708-10329-1-git-send-email-christian.babeux@efficios.com> Message-ID: <20130228225429.GA915@Krystal> * Christian Babeux (christian.babeux at efficios.com) wrote: > > Signed-off-by: Christian Babeux > --- > converter/babeltrace.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/converter/babeltrace.c b/converter/babeltrace.c > index 20ded00..28c63cb 100644 > --- a/converter/babeltrace.c > +++ b/converter/babeltrace.c > @@ -205,6 +205,7 @@ static int get_names_args(poptContext *pc) > } else { > fprintf(stderr, "[error] unknown field name type %s\n", str); > free(strlist); > + strlist = NULL; could we just remove the free(strlist), and just have: ret = -EINVAL; goto end; instead ? Thanks, Mathieu > ret = -EINVAL; > goto end; > } > -- > 1.8.1.3 > -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From christian.babeux at efficios.com Thu Feb 28 18:13:26 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Thu, 28 Feb 2013 18:13:26 -0500 Subject: [lttng-dev] [PATCH babeltrace] Fix: Undefined behavior of double free on strlist in get_names_args In-Reply-To: <20130228225429.GA915@Krystal> References: <20130228225429.GA915@Krystal> Message-ID: <1362093206-12791-1-git-send-email-christian.babeux@efficios.com> Signed-off-by: Christian Babeux --- converter/babeltrace.c | 1 - 1 file changed, 1 deletion(-) diff --git a/converter/babeltrace.c b/converter/babeltrace.c index 20ded00..ed19fa8 100644 --- a/converter/babeltrace.c +++ b/converter/babeltrace.c @@ -204,7 +204,6 @@ static int get_names_args(poptContext *pc) opt_payload_field_names = 0; } else { fprintf(stderr, "[error] unknown field name type %s\n", str); - free(strlist); ret = -EINVAL; goto end; } -- 1.8.1.3 From jeremie.galarneau at efficios.com Thu Feb 28 18:30:12 2013 From: jeremie.galarneau at efficios.com (=?UTF-8?q?J=C3=A9r=C3=A9mie=20Galarneau?=) Date: Thu, 28 Feb 2013 18:30:12 -0500 Subject: [lttng-dev] [PATCH babeltrace] Fix: Ensure the specified input format is CTF Message-ID: <1362094212-27792-1-git-send-email-jeremie.galarneau@efficios.com> Add a check to make sure the input trace format argument passed to the babeltrace converter is "ctf" as it is currently the only one supported. Add a note to this effect in the man page. Fixes #462 Signed-off-by: J?r?mie Galarneau --- converter/babeltrace.c | 2 +- doc/babeltrace.1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/converter/babeltrace.c b/converter/babeltrace.c index 20ded00..6847248 100644 --- a/converter/babeltrace.c +++ b/converter/babeltrace.c @@ -607,7 +607,7 @@ int main(int argc, char **argv) } } fmt_read = bt_lookup_format(g_quark_from_static_string(opt_input_format)); - if (!fmt_read) { + if (!fmt_read || fmt_read->name != g_quark_from_static_string("ctf")) { fprintf(stderr, "[error] Format \"%s\" is not supported.\n\n", opt_input_format); partial_error = 1; diff --git a/doc/babeltrace.1 b/doc/babeltrace.1 index 3196299..78e9055 100644 --- a/doc/babeltrace.1 +++ b/doc/babeltrace.1 @@ -29,7 +29,7 @@ Input trace FILE(s) or directory(ies) Output trace path (default: stdout) .TP .BR "-i, --input-format FORMAT" -Input trace format (default: ctf) +Input trace format (default: ctf). CTF is currently the only supported input format. .TP .BR "-o, --output-format FORMAT" Output trace format (default: text) -- 1.8.1.4 From simon.marchi at polymtl.ca Thu Feb 28 18:42:17 2013 From: simon.marchi at polymtl.ca (Simon Marchi) Date: Thu, 28 Feb 2013 18:42:17 -0500 Subject: [lttng-dev] [PATCH lttng-tools] Add with-sessiond-bin configure option Message-ID: <1362094937-6677-1-git-send-email-simon.marchi@polymtl.ca> I also cleaned up the little check_sessiond function. The check using access(2) was only done for the command line option, but I think it is a good idea to do it wherever the path comes from. closes #441 Signed-off-by: Simon Marchi --- configure.ac | 17 +++++++++++++++++ src/bin/lttng/lttng.c | 37 ++++++++++++++++++++----------------- 2 files changed, 37 insertions(+), 17 deletions(-) diff --git a/configure.ac b/configure.ac index 71fbb60..7349713 100644 --- a/configure.ac +++ b/configure.ac @@ -91,12 +91,20 @@ AC_ARG_WITH([consumerd64-libdir], [CONSUMERD64_LIBDIR='']) AC_SUBST([CONSUMERD64_LIBDIR]) +AC_ARG_WITH([sessiond-bin], + AS_HELP_STRING([--with-sessiond-bin], + [Location of the sessiond executable (including the filename)]), + [SESSIOND_BIN="$withval"], + [SESSIOND_BIN='']) +AC_SUBST([SESSIOND_BIN]) + AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_BIN], "$CONSUMERD32_BIN", [Location of the 32-bit consumerd executable.]) AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_BIN], "$CONSUMERD64_BIN", [Location of the 64-bit consumerd executable]) AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_LIBDIR], "$CONSUMERD32_LIBDIR", [Search for consumerd 32-bit libraries in this location.]) AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_LIBDIR], "$CONSUMERD64_LIBDIR", [Search for consumerd 64-bit libraries in this location.]) AC_DEFINE_UNQUOTED([CONFIG_BABELTRACE_BIN], "$BABELTRACE_BIN", [Location of the babeltrace viewer executable.]) AC_DEFINE_UNQUOTED([CONFIG_LTTV_GUI_BIN], "$LTTV_GUI_BIN", [Location of the lttv GUI viewer executable.]) +AC_DEFINE_UNQUOTED([CONFIG_SESSIOND_BIN], "$SESSIOND_BIN", [Location of the sessiond executable.]) # Check for pthread AC_CHECK_LIB([pthread], [pthread_create], [], @@ -383,6 +391,15 @@ AS_ECHO("`eval eval echo $libdir`") # If we build the sessiond, print the paths it will use AS_IF([test "x$consumerd_only" = "xno"],[ AS_ECHO() + AS_ECHO_N("The lttng command will look for the lttng-sessiond executable at: ") + AS_IF([test "$SESSIOND_BIN" = ""],[ + AS_ECHO_N("`eval eval echo $bindir`") + AS_ECHO("/lttng-sessiond") + ],[ + AS_ECHO("$SESSIOND_BIN") + ]) + + AS_ECHO() AS_ECHO("The sessiond daemon will look in the following directories: ") AS_ECHO_N("32-bit consumerd executable at: ") AS_IF([test "$CONSUMERD32_BIN" = ""],[ diff --git a/src/bin/lttng/lttng.c b/src/bin/lttng/lttng.c index 8562144..4097956 100644 --- a/src/bin/lttng/lttng.c +++ b/src/bin/lttng/lttng.c @@ -346,35 +346,38 @@ end: static int check_sessiond(void) { int ret; - char *pathname = NULL, *alloc_pathname = NULL; + char *pathname = NULL; ret = lttng_session_daemon_alive(); if (ret == 0) { /* not alive */ /* Try command line option path */ - if (opt_sessiond_path != NULL) { - ret = access(opt_sessiond_path, F_OK | X_OK); - if (ret < 0) { - ERR("No such file or access denied: %s", opt_sessiond_path); - goto end; - } - pathname = opt_sessiond_path; - } else { - /* Try LTTNG_SESSIOND_PATH env variable */ + pathname = opt_sessiond_path; + + /* Try LTTNG_SESSIOND_PATH env variable */ + if (pathname == NULL) { pathname = getenv(DEFAULT_SESSIOND_PATH_ENV); } - /* Let's rock and roll */ + /* Try with configured path */ if (pathname == NULL) { - ret = asprintf(&alloc_pathname, INSTALL_BIN_PATH "/lttng-sessiond"); - if (ret < 0) { - perror("asprintf spawn sessiond"); - goto end; + if (CONFIG_SESSIOND_BIN[0] != '\0') { + pathname = CONFIG_SESSIOND_BIN; } - pathname = alloc_pathname; + } + + /* Let's rock and roll while trying the default path */ + if (pathname == NULL) { + pathname = INSTALL_BIN_PATH "/lttng-sessiond"; + } + + /* Check existence and permissions */ + ret = access(pathname, F_OK | X_OK); + if (ret < 0) { + ERR("No such file or access denied: %s", pathname); + goto end; } ret = spawn_sessiond(pathname); - free(alloc_pathname); if (ret < 0) { ERR("Problem occurred when starting %s", pathname); goto end; -- 1.7.1 From yannick.brosseau at gmail.com Thu Feb 28 19:21:30 2013 From: yannick.brosseau at gmail.com (Yannick Brosseau) Date: Thu, 28 Feb 2013 19:21:30 -0500 Subject: [lttng-dev] Need UST for LTTng-tool to build Message-ID: <512FF48A.7050809@gmail.com> Hi Jon, To save you the trouble of trying to find the source of the latest FTBFS of LTTng-Tools, here's the solution. You need to apply the commit: Remove direct dependency of probes on urcu-bp fd9619bcf98bae43e3418b6c61d2727d49d7d54b to the lttng-ust package before you can build lttng-tools Yannick From jbernard at debian.org Thu Feb 28 20:08:39 2013 From: jbernard at debian.org (Jon Bernard) Date: Thu, 28 Feb 2013 20:08:39 -0500 Subject: [lttng-dev] Need UST for LTTng-tool to build In-Reply-To: <512FF48A.7050809@gmail.com> References: <512FF48A.7050809@gmail.com> Message-ID: <20130301010839.GA2622@quintessa> * Yannick Brosseau wrote: > Hi Jon, > > To save you the trouble of trying to find the source of the latest FTBFS > of LTTng-Tools, here's the solution. > > You need to apply the commit: > > Remove direct dependency of probes on urcu-bp > fd9619bcf98bae43e3418b6c61d2727d49d7d54b > > to the lttng-ust package before you can build lttng-tools This is most helpful, thank you very much. I will quickly replace the pile hacks I just uploaded ;) Also, just watched your LCA talk. Well done, I really enjoyed it. -- Jon From mathieu.desnoyers at efficios.com Thu Feb 28 21:27:53 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 28 Feb 2013 21:27:53 -0500 Subject: [lttng-dev] [PATCH babeltrace] Fix: Undefined behavior of double free on strlist in get_names_args In-Reply-To: <1362093206-12791-1-git-send-email-christian.babeux@efficios.com> References: <20130228225429.GA915@Krystal> <1362093206-12791-1-git-send-email-christian.babeux@efficios.com> Message-ID: <20130301022753.GA3321@Krystal> * Christian Babeux (christian.babeux at efficios.com) wrote: > > Signed-off-by: Christian Babeux Merged, thanks! Mathieu > --- > converter/babeltrace.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/converter/babeltrace.c b/converter/babeltrace.c > index 20ded00..ed19fa8 100644 > --- a/converter/babeltrace.c > +++ b/converter/babeltrace.c > @@ -204,7 +204,6 @@ static int get_names_args(poptContext *pc) > opt_payload_field_names = 0; > } else { > fprintf(stderr, "[error] unknown field name type %s\n", str); > - free(strlist); > ret = -EINVAL; > goto end; > } > -- > 1.8.1.3 > -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Thu Feb 28 21:28:51 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 28 Feb 2013 21:28:51 -0500 Subject: [lttng-dev] [PATCH babeltrace] Fix: Ensure the specified input format is CTF In-Reply-To: <1362094212-27792-1-git-send-email-jeremie.galarneau@efficios.com> References: <1362094212-27792-1-git-send-email-jeremie.galarneau@efficios.com> Message-ID: <20130301022851.GB3321@Krystal> * J?r?mie Galarneau (jeremie.galarneau at efficios.com) wrote: > Add a check to make sure the input trace format argument passed to the > babeltrace converter is "ctf" as it is currently the only one supported. > > Add a note to this effect in the man page. > > Fixes #462 merged, thanks! Mathieu > > Signed-off-by: J?r?mie Galarneau > --- > converter/babeltrace.c | 2 +- > doc/babeltrace.1 | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/converter/babeltrace.c b/converter/babeltrace.c > index 20ded00..6847248 100644 > --- a/converter/babeltrace.c > +++ b/converter/babeltrace.c > @@ -607,7 +607,7 @@ int main(int argc, char **argv) > } > } > fmt_read = bt_lookup_format(g_quark_from_static_string(opt_input_format)); > - if (!fmt_read) { > + if (!fmt_read || fmt_read->name != g_quark_from_static_string("ctf")) { > fprintf(stderr, "[error] Format \"%s\" is not supported.\n\n", > opt_input_format); > partial_error = 1; > diff --git a/doc/babeltrace.1 b/doc/babeltrace.1 > index 3196299..78e9055 100644 > --- a/doc/babeltrace.1 > +++ b/doc/babeltrace.1 > @@ -29,7 +29,7 @@ Input trace FILE(s) or directory(ies) > Output trace path (default: stdout) > .TP > .BR "-i, --input-format FORMAT" > -Input trace format (default: ctf) > +Input trace format (default: ctf). CTF is currently the only supported input format. > .TP > .BR "-o, --output-format FORMAT" > Output trace format (default: text) > -- > 1.8.1.4 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From teawater at gmail.com Thu Feb 28 21:37:26 2013 From: teawater at gmail.com (Hui Zhu) Date: Fri, 1 Mar 2013 10:37:26 +0800 Subject: [lttng-dev] [PATCH 3/5] Read CTF by the ctf target In-Reply-To: <512F9182.3080104@redhat.com> References: <1361931459-3953-1-git-send-email-yao@codesourcery.com> <1361931459-3953-4-git-send-email-yao@codesourcery.com> <512F9182.3080104@redhat.com> Message-ID: On Fri, Mar 1, 2013 at 1:18 AM, Pedro Alves wrote: > (not a complete review) > > On 02/27/2013 02:17 AM, Yao Qi wrote: > >> +if test "x$with_babeltrace" != "xno"; then >> + saved_CFLAGS="$CFLAGS" >> + CFLAGS="$CFLAGS $btinc" >> + AC_MSG_CHECKING([for babeltrace]) >> + AC_TRY_COMPILE([ >> +#include >> +#include >> +#include > > We know from previous patches that the latest released > babeltrace breaks gdb, due to the lookup_enum function. Does > this catch that? I see namespacing fixes going into > babeltrace as recently as last 15th. Do we know if > babeltrace's API is more or less done and close to a release? Hi Mathieu, Could you help us with this question? Thanks, Hui > >> + ],[], >> + [AC_MSG_RESULT([yes]); AC_DEFINE(HAVE_LIBBABELTRACE, 1, [Define if libbabeltrace is available])], >> + [AC_MSG_RESULT([no]); btlibs= ; btinc= ]) >> + CFLAGS="$saved_CFLAGS" >> +fi >> + >> +# Flags needed for UST > > babeltrace > >> +AC_SUBST(btlibs) >> +AC_SUBST(btinc) >> + > > -- > Pedro Alves >