Fix: don't generate 0-len array in tracepoint probes
Quoted 47 lines · ----- On May 30, 2016, at 8:08 PM, Sebastien Boisvert [email protected] wrote:
Greetings,
This is a response to the message
https://lists.lttng.org/pipermail/lttng-dev/2016-May/026066.htmlThe builds below were generated with:
lttng-ust
ba5b4491f94109eaca10b2c285f8d1f116a38e5cgcc 4.9.3-8ubuntu2~14.04First, I compiled lttng-ust with the "-pedantic" option of gcc to verify that this causes an array
of compilation errors.sboisvert@Z1:~/lttng-ust$ ./bootstrap sboisvert@Z1:~/lttng-ust$ ./configure --prefix=$HOME/lttng-ust.build sboisvert@Z1:~/lttng-ust$ make CFLAGS="-pedantic" &> log sboisvert@Z1:~/lttng-ust$ grep error log //#error UST_COMPONENT is undefined ../include/lttng/ust-tracepoint-event.h:291:40: error: zero or negative size array '__event_fields___lttng_ust_statedump___start' ../include/lttng/ust-tracepoint-event.h:291:40: error: zero or negative size array '__event_fields___lttng_ust_statedump___end'I applied the patch that Mathieu provided, and built the project and ran the tests.
sboisvert@Z1:~/lttng-ust$ patch -p1 < ~/lttng-ust-empty-array.patch patching file include/lttng/ust-tracepoint-event.hsboisvert@Z1:~/lttng-ust$ make CFLAGS="-pedantic" &> log sboisvert@Z1:~/lttng-ust$ cd tests============================================================================
Testsuite summary for lttng-ust 2.9.0-pre
============================================================================
# TOTAL: 51
# PASS: 51
# SKIP: 0
# XFAIL: 0
# FAIL: 0
# XPASS: 0
# ERROR: 0
============================================================================
Quoted 7 lines
So, this patch improves the user experience when one is using advanced linting flags as well as
tracepoint event probes with no arguments, and it does not break the envelope of known behaviour.+1
Great! I have run the make check tests from lttng-tools also with the patch applied, and they also all pass. So I am merging this into master, 2.8, 2.7 of lttng-ust.
Thanks for helping us improve LTTng!
Mathieu
Quoted 4 lines
_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Signature · 7 lines
Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com _______________________________________________ lttng-dev mailing list [email protected] https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev