[lttng-dev] [PATCH lttng-tools] Fix typo

2019-02-15 Thread Yannick Lamarre
Signed-off-by: Yannick Lamarre 
---
 src/common/compat/poll.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/common/compat/poll.h b/src/common/compat/poll.h
index d4bd87f5..ad5bca21 100644
--- a/src/common/compat/poll.h
+++ b/src/common/compat/poll.h
@@ -177,7 +177,7 @@ extern int compat_epoll_del(struct lttng_poll_event 
*events, int fd);
 extern int compat_epoll_mod(struct lttng_poll_event *events,
int fd, uint32_t req_events);
 #define lttng_poll_mod(events, fd, req_events) \
-   compat_epoll_add(events, fd, req_events)
+   compat_epoll_mod(events, fd, req_events)
 
 /*
  * Set up the poll set limits variable poll_max_size
@@ -356,12 +356,12 @@ extern int compat_poll_del(struct lttng_poll_event 
*events, int fd);
compat_poll_del(events, fd)
 
 /*
- * Modify an fd's events in the epoll set.
+ * Modify an fd's events in the poll set.
  */
 extern int compat_poll_mod(struct lttng_poll_event *events,
int fd, uint32_t req_events);
 #define lttng_poll_mod(events, fd, req_events) \
-   compat_poll_add(events, fd, req_events)
+   compat_poll_mod(events, fd, req_events)
 
 /*
  * Set up the poll set limits variable poll_max_size
-- 
2.11.0

___
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev


Re: [lttng-dev] [RFC PATCH lttng-tools] RFC: Add POPT_CFLAGS to lttng_CFLAGS

2019-02-15 Thread Michael Jeanson
On 2019-02-15 2:52 p.m., Yannick Lamarre wrote:
> The generated makefile was ignoring POPT_CFLAGS when compiling
> lttng, but was adding POPT_LIBS to lttng_LDADD. With this commit,
> make now honors both settings for applications and tests.
> 
> Fixes: #1165
> 
> Signed-off-by: Yannick Lamarre 
> ---
>  src/bin/lttng/Makefile.am  | 2 ++
>  tests/regression/kernel/Makefile.am| 2 +-
>  tests/regression/ust/multi-lib/Makefile.am | 8 
>  3 files changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/src/bin/lttng/Makefile.am b/src/bin/lttng/Makefile.am
> index b0e1247d..62ae0593 100644
> --- a/src/bin/lttng/Makefile.am
> +++ b/src/bin/lttng/Makefile.am
> @@ -28,6 +28,8 @@ lttng_SOURCES = command.h conf.c conf.h commands/start.c \
>   commands/disable_rotation.c \
>   utils.c utils.h lttng.c
>  
> +lttng_CFLAGS = $(AM_CFLAGS) $(POPT_CFLAGS)

By convention AM_CFLAGS should come last, it also has to do with priority.

> +
>  lttng_LDADD = $(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la \
>   $(top_builddir)/src/common/libcommon.la \
>   $(top_builddir)/src/common/config/libconfig.la \
> diff --git a/tests/regression/kernel/Makefile.am 
> b/tests/regression/kernel/Makefile.am
> index a787e4fa..3ab6d75b 100644
> --- a/tests/regression/kernel/Makefile.am
> +++ b/tests/regression/kernel/Makefile.am
> @@ -7,7 +7,7 @@ EXTRA_DIST = test_event_basic test_all_events test_syscall \
>  noinst_PROGRAMS = select_poll_epoll
>  select_poll_epoll_SOURCES = select_poll_epoll.c
>  select_poll_epoll_LDADD = $(POPT_LIBS)
> -select_poll_epoll_CFLAGS = -fno-stack-protector -D_FORTIFY_SOURCE=0 
> $(AM_CFLAGS)
> +select_poll_epoll_CFLAGS = $(POPT_CFLAGS) -fno-stack-protector 
> -D_FORTIFY_SOURCE=0 $(AM_CFLAGS)

POPT_CFLAGS should come after the specific flag and before AM_CFLAGS

>  
>  all-local:
>   @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
> diff --git a/tests/regression/ust/multi-lib/Makefile.am 
> b/tests/regression/ust/multi-lib/Makefile.am
> index 3fb4ae74..17ccf3e6 100644
> --- a/tests/regression/ust/multi-lib/Makefile.am
> +++ b/tests/regression/ust/multi-lib/Makefile.am
> @@ -3,13 +3,13 @@ EXTRA_DIST = test_multi_lib
>  noinst_PROGRAMS = exec-with-callsites exec-without-callsites
>  
>  exec_with_callsites_SOURCES = multi-lib-test.c callsites.c
> -exec_with_callsites_LDFLAGS = -ldl -lpopt
> -exec_with_callsites_CFLAGS = $(AM_CFLAGS) -DHAS_CALLSITES=1
> +exec_with_callsites_LDFLAGS = -ldl $(POPT_LIBS)
> +exec_with_callsites_CFLAGS = $(POPT_CFLAGS) $(AM_CFLAGS) -DHAS_CALLSITES=1
>  
>  exec_without_callsites_SOURCES = multi-lib-test.c
> -exec_without_callsites_LDFLAGS = -ldl -lpopt -llttng-ust
> +exec_without_callsites_LDFLAGS = -ldl $(POPT_LIBS) -llttng-ust
>  exec_without_callsites_LDADD = probes.o
> -exec_without_callsites_CFLAGS = $(AM_CFLAGS) -DHAS_CALLSITES=0
> +exec_without_callsites_CFLAGS = $(POPT_CFLAGS) $(AM_CFLAGS) -DHAS_CALLSITES=0
>  
>  PROBES_SRC=probes.c probes.h
>  PROBES_LDF=-shared -module -llttng-ust -avoid-version -rpath 
> $(abs_builddir)/.libs/
> 

___
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev


[lttng-dev] [RFC PATCH lttng-tools] RFC: Enforce DL_LIBS value instead of hard coded -ldl

2019-02-15 Thread Yannick Lamarre
Generated makefiles would ignore DL_LIBS value selected by configure
script and use the hard coded value -ldl. Generated makefiles will
now use DL_LIBS.

Refs: #1165

Signed-off-by: Yannick Lamarre 
---
 src/common/testpoint/Makefile.am   | 2 +-
 tests/regression/ust/baddr-statedump/Makefile.am   | 2 +-
 tests/regression/ust/ust-dl/Makefile.am| 2 +-
 tests/utils/testapp/userspace-probe-sdt-binary/Makefile.am | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/common/testpoint/Makefile.am b/src/common/testpoint/Makefile.am
index 5c15725e..a2f9d407 100644
--- a/src/common/testpoint/Makefile.am
+++ b/src/common/testpoint/Makefile.am
@@ -1,4 +1,4 @@
 noinst_LTLIBRARIES = libtestpoint.la
 
 libtestpoint_la_SOURCES = testpoint.h testpoint.c
-libtestpoint_la_LIBADD = -ldl
+libtestpoint_la_LIBADD = $(DL_LIBS)
diff --git a/tests/regression/ust/baddr-statedump/Makefile.am 
b/tests/regression/ust/baddr-statedump/Makefile.am
index bf327179..bf51f948 100644
--- a/tests/regression/ust/baddr-statedump/Makefile.am
+++ b/tests/regression/ust/baddr-statedump/Makefile.am
@@ -6,7 +6,7 @@ AM_CPPFLAGS += -I$(srcdir) -g
 
 noinst_PROGRAMS = prog
 prog_SOURCES = prog.c tp.c tp.h
-prog_LDADD = -llttng-ust -ldl
+prog_LDADD = -llttng-ust $(DL_LIBS)
 
 noinst_SCRIPTS = test_baddr-statedump test_baddr-statedump.py
 EXTRA_DIST = test_baddr-statedump test_baddr-statedump.py
diff --git a/tests/regression/ust/ust-dl/Makefile.am 
b/tests/regression/ust/ust-dl/Makefile.am
index 9889e85a..c51e072f 100644
--- a/tests/regression/ust/ust-dl/Makefile.am
+++ b/tests/regression/ust/ust-dl/Makefile.am
@@ -19,7 +19,7 @@ AM_CPPFLAGS += -I$(srcdir) -g
 
 noinst_PROGRAMS = prog
 prog_SOURCES = prog.c
-prog_LDADD = -ldl
+prog_LDADD = $(DL_LIBS)
 
 noinst_LTLIBRARIES = libzzz.la libbar.la libfoo.la libtp.la
 
diff --git a/tests/utils/testapp/userspace-probe-sdt-binary/Makefile.am 
b/tests/utils/testapp/userspace-probe-sdt-binary/Makefile.am
index e86939b4..d79ce0ea 100644
--- a/tests/utils/testapp/userspace-probe-sdt-binary/Makefile.am
+++ b/tests/utils/testapp/userspace-probe-sdt-binary/Makefile.am
@@ -3,7 +3,7 @@ BUILT_SOURCES = foobar_provider.h
 
 noinst_PROGRAMS = userspace-probe-sdt-binary
 userspace_probe_sdt_binary_SOURCES = userspace-probe-sdt-binary.c sema.h sema.c
-userspace_probe_sdt_binary_LDADD = foobar_provider.o libfoo.la libbar.la -ldl
+userspace_probe_sdt_binary_LDADD = foobar_provider.o libfoo.la libbar.la 
$(DL_LIBS)
 userspace_probe_sdt_binary_CFLAGS = -I$(abs_builddir)
 nodist_userspace_probe_sdt_binary_SOURCES = $(abs_builddir)/foobar_provider.h
 
-- 
2.11.0

___
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev


[lttng-dev] [RFC PATCH lttng-tools] RFC: Add POPT_CFLAGS to lttng_CFLAGS

2019-02-15 Thread Yannick Lamarre
The generated makefile was ignoring POPT_CFLAGS when compiling
lttng, but was adding POPT_LIBS to lttng_LDADD. With this commit,
make now honors both settings for applications and tests.

Fixes: #1165

Signed-off-by: Yannick Lamarre 
---
 src/bin/lttng/Makefile.am  | 2 ++
 tests/regression/kernel/Makefile.am| 2 +-
 tests/regression/ust/multi-lib/Makefile.am | 8 
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/bin/lttng/Makefile.am b/src/bin/lttng/Makefile.am
index b0e1247d..62ae0593 100644
--- a/src/bin/lttng/Makefile.am
+++ b/src/bin/lttng/Makefile.am
@@ -28,6 +28,8 @@ lttng_SOURCES = command.h conf.c conf.h commands/start.c \
commands/disable_rotation.c \
utils.c utils.h lttng.c
 
+lttng_CFLAGS = $(AM_CFLAGS) $(POPT_CFLAGS)
+
 lttng_LDADD = $(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la \
$(top_builddir)/src/common/libcommon.la \
$(top_builddir)/src/common/config/libconfig.la \
diff --git a/tests/regression/kernel/Makefile.am 
b/tests/regression/kernel/Makefile.am
index a787e4fa..3ab6d75b 100644
--- a/tests/regression/kernel/Makefile.am
+++ b/tests/regression/kernel/Makefile.am
@@ -7,7 +7,7 @@ EXTRA_DIST = test_event_basic test_all_events test_syscall \
 noinst_PROGRAMS = select_poll_epoll
 select_poll_epoll_SOURCES = select_poll_epoll.c
 select_poll_epoll_LDADD = $(POPT_LIBS)
-select_poll_epoll_CFLAGS = -fno-stack-protector -D_FORTIFY_SOURCE=0 
$(AM_CFLAGS)
+select_poll_epoll_CFLAGS = $(POPT_CFLAGS) -fno-stack-protector 
-D_FORTIFY_SOURCE=0 $(AM_CFLAGS)
 
 all-local:
@if [ x"$(srcdir)" != x"$(builddir)" ]; then \
diff --git a/tests/regression/ust/multi-lib/Makefile.am 
b/tests/regression/ust/multi-lib/Makefile.am
index 3fb4ae74..17ccf3e6 100644
--- a/tests/regression/ust/multi-lib/Makefile.am
+++ b/tests/regression/ust/multi-lib/Makefile.am
@@ -3,13 +3,13 @@ EXTRA_DIST = test_multi_lib
 noinst_PROGRAMS = exec-with-callsites exec-without-callsites
 
 exec_with_callsites_SOURCES = multi-lib-test.c callsites.c
-exec_with_callsites_LDFLAGS = -ldl -lpopt
-exec_with_callsites_CFLAGS = $(AM_CFLAGS) -DHAS_CALLSITES=1
+exec_with_callsites_LDFLAGS = -ldl $(POPT_LIBS)
+exec_with_callsites_CFLAGS = $(POPT_CFLAGS) $(AM_CFLAGS) -DHAS_CALLSITES=1
 
 exec_without_callsites_SOURCES = multi-lib-test.c
-exec_without_callsites_LDFLAGS = -ldl -lpopt -llttng-ust
+exec_without_callsites_LDFLAGS = -ldl $(POPT_LIBS) -llttng-ust
 exec_without_callsites_LDADD = probes.o
-exec_without_callsites_CFLAGS = $(AM_CFLAGS) -DHAS_CALLSITES=0
+exec_without_callsites_CFLAGS = $(POPT_CFLAGS) $(AM_CFLAGS) -DHAS_CALLSITES=0
 
 PROBES_SRC=probes.c probes.h
 PROBES_LDF=-shared -module -llttng-ust -avoid-version -rpath 
$(abs_builddir)/.libs/
-- 
2.11.0

___
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev


Re: [lttng-dev] Tracepoints firing without being enabled in LTTng

2019-02-15 Thread Francis Deslauriers
Can you start the lttng-sessiond in verbose mode using the following
command:
> lttng-sessiond -vvv
and then do the lttng create, start of application and lttng view on
another console.

Then copy the output of the sessiond on https://pastebin.com/ and send us
the link.

Thank you,
Francis

Le ven. 15 févr. 2019, à 14 h 36, Mosleh Uddin  a
écrit :

> That's correct, I don't enable any events or do: lttng start.
> Here is some snapshots of starting everything up, followed by starting my
> application.
> [image: image.png]
>
> Here are the outputs for the commands:
>
> [image: image.png]
>
> [image: image.png]
>
> [image: image.png]
>
> Note that even though the session is inactive, when a trace event occurs
> in my application it is being recorded in the appropriate directory:
>
> [image: image.png]
>
> Also maybe important, the system has root only user. Would having the
> application belonging to a different user and trying to run as root cause
> these kinds of complications? I did notice when testing on a raspberry pi
> that running an application as a root user would mean running sessions as
> root user as well.
>
> Thanks,
> Mosleh
>
> On Fri, Feb 15, 2019 at 11:55 AM Francis Deslauriers <
> francis.deslauri...@efficios.com> wrote:
>
>> Adding back lttng-dev mailing list.
>>
>> So you don't even run a lttng-enable-event command?
>> That's odd.
>>
>> Can you send us the output of the following commands:
>> Is it possible that there are other lttng-sessiond daemons running on
>> the machine?
>> > ps aux | grep "lttng-sessiond"
>> Verify if there are other active tracing sessions:
>> > lttng list
>> Check the details of the current session:
>> > lttng status
>>
>> Thank you,
>> Francis
>>
>> Le ven. 15 févr. 2019, à 11 h 29, Mosleh Uddin  a
>> écrit :
>> >
>> > Hi Francis,
>> >
>> > Thank you for the quick response.
>> > Just to clear things up, my application is running when I run that
>> command.
>> >
>> > The commands I am running are:
>> > > lttng-sessiond -d
>> > > lttng create my-sess --live
>> > After this command I start my application. If I then do the command:
>> > > lttng view
>> > I will see the tracepoints in the application in the terminal even
>> though I have not done: lttng start.
>> >
>> > I thought it was strange that I cannot find my application in the:
>> lttng list command under any domain.
>> > Also the reason I start my application after creating a session is
>> because the system automatically starts the application using systemd,
>> > in order to get tracing data at all I have to manually stop the
>> application and start it again after creating a session.
>> >
>> > Thanks again for any help,
>> > Mosleh
>> >
>> > On Fri, Feb 15, 2019 at 10:32 AM Francis Deslauriers <
>> francis.deslauri...@efficios.com> wrote:
>> >>
>> >> Hi Mosleh,
>> >> It's expected to not see any event when running lttng list -u if no
>> >> lttng-ust instrumented applications are running.
>> >>
>> >> What are the exact lttng commands you are running to see those
>> >> unexpected events?
>> >>
>> >> Thank you,
>> >> Francis
>> >>
>> >>
>> >> Le ven. 15 févr. 2019, à 10 h 08, Mosleh Uddin 
>> a écrit :
>> >> >
>> >> > Hello,
>> >> >
>> >> > I am having a strange issue with my current application. For some
>> context, I have integrated LTTng into a Yocto build and put custom trace
>> points in my embedded system application. Once I load the built image onto
>> my system and start a session daemon, I try to list all available userspace
>> events (using lttng list -u), but no events show up.
>> >> >
>> >> > The strange occurrence is when I create a session (lltng create
>> my-sess) and not start tracing the trace events will display on the screen
>> regardless (when starting session in live mode with lttng view). I was
>> wondering if anyone has any insight on this issue I am having.
>> >> >
>> >> > Thanks for any assistance,
>> >> > Mosleh
>> >> > ___
>> >> > lttng-dev mailing list
>> >> > lttng-dev@lists.lttng.org
>> >> > https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>> >>
>> >> --
>> >> Francis Deslauriers
>> >> Computer Engineer
>> >> EfficiOS inc.
>>
>>
>>
>> --
>> Francis Deslauriers
>> Computer Engineer
>> EfficiOS inc.
>>
> ___
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>


-- 
Francis Deslauriers
Computer Engineer
EfficiOS inc.
___
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev


Re: [lttng-dev] Tracepoints firing without being enabled in LTTng

2019-02-15 Thread Francis Deslauriers
Adding back lttng-dev mailing list.

So you don't even run a lttng-enable-event command?
That's odd.

Can you send us the output of the following commands:
Is it possible that there are other lttng-sessiond daemons running on
the machine?
> ps aux | grep "lttng-sessiond"
Verify if there are other active tracing sessions:
> lttng list
Check the details of the current session:
> lttng status

Thank you,
Francis

Le ven. 15 févr. 2019, à 11 h 29, Mosleh Uddin  a écrit :
>
> Hi Francis,
>
> Thank you for the quick response.
> Just to clear things up, my application is running when I run that command.
>
> The commands I am running are:
> > lttng-sessiond -d
> > lttng create my-sess --live
> After this command I start my application. If I then do the command:
> > lttng view
> I will see the tracepoints in the application in the terminal even though I 
> have not done: lttng start.
>
> I thought it was strange that I cannot find my application in the: lttng list 
> command under any domain.
> Also the reason I start my application after creating a session is because 
> the system automatically starts the application using systemd,
> in order to get tracing data at all I have to manually stop the application 
> and start it again after creating a session.
>
> Thanks again for any help,
> Mosleh
>
> On Fri, Feb 15, 2019 at 10:32 AM Francis Deslauriers 
>  wrote:
>>
>> Hi Mosleh,
>> It's expected to not see any event when running lttng list -u if no
>> lttng-ust instrumented applications are running.
>>
>> What are the exact lttng commands you are running to see those
>> unexpected events?
>>
>> Thank you,
>> Francis
>>
>>
>> Le ven. 15 févr. 2019, à 10 h 08, Mosleh Uddin  a 
>> écrit :
>> >
>> > Hello,
>> >
>> > I am having a strange issue with my current application. For some context, 
>> > I have integrated LTTng into a Yocto build and put custom trace points in 
>> > my embedded system application. Once I load the built image onto my system 
>> > and start a session daemon, I try to list all available userspace events 
>> > (using lttng list -u), but no events show up.
>> >
>> > The strange occurrence is when I create a session (lltng create my-sess) 
>> > and not start tracing the trace events will display on the screen 
>> > regardless (when starting session in live mode with lttng view). I was 
>> > wondering if anyone has any insight on this issue I am having.
>> >
>> > Thanks for any assistance,
>> > Mosleh
>> > ___
>> > lttng-dev mailing list
>> > lttng-dev@lists.lttng.org
>> > https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>>
>> --
>> Francis Deslauriers
>> Computer Engineer
>> EfficiOS inc.



-- 
Francis Deslauriers
Computer Engineer
EfficiOS inc.
___
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev


Re: [lttng-dev] Tracepoints firing without being enabled in LTTng

2019-02-15 Thread Francis Deslauriers
Hi Mosleh,
It's expected to not see any event when running lttng list -u if no
lttng-ust instrumented applications are running.

What are the exact lttng commands you are running to see those
unexpected events?

Thank you,
Francis


Le ven. 15 févr. 2019, à 10 h 08, Mosleh Uddin  a écrit :
>
> Hello,
>
> I am having a strange issue with my current application. For some context, I 
> have integrated LTTng into a Yocto build and put custom trace points in my 
> embedded system application. Once I load the built image onto my system and 
> start a session daemon, I try to list all available userspace events (using 
> lttng list -u), but no events show up.
>
> The strange occurrence is when I create a session (lltng create my-sess) and 
> not start tracing the trace events will display on the screen regardless 
> (when starting session in live mode with lttng view). I was wondering if 
> anyone has any insight on this issue I am having.
>
> Thanks for any assistance,
> Mosleh
> ___
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

-- 
Francis Deslauriers
Computer Engineer
EfficiOS inc.
___
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev


[lttng-dev] Tracepoints firing without being enabled in LTTng

2019-02-15 Thread Mosleh Uddin
Hello,

I am having a strange issue with my current application. For some context,
I have integrated LTTng into a Yocto build and put custom trace points in
my embedded system application. Once I load the built image onto my system
and start a session daemon, I try to list all available userspace events
(using lttng list -u), but no events show up.

The strange occurrence is when I create a session (lltng create my-sess)
and not start tracing the trace events will display on the screen
regardless (when starting session in live mode with lttng view). I was
wondering if anyone has any insight on this issue I am having.

Thanks for any assistance,
Mosleh
___
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev