Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: sboisvert@gydle.com (Sebastien Boisvert)
Subject: [lttng-dev] [RFC PATCH lttng-ust] Fix: don't generate 0-len array in tracepoint probes
Date: Mon, 30 May 2016 14:08:22 -0400	[thread overview]
Message-ID: <574C8196.8020508@gydle.com> (raw)

Greetings,

This is a response to the message https://lists.lttng.org/pipermail/lttng-dev/2016-May/026066.html

The builds below were generated with:

lttng-ust ba5b4491f94109eaca10b2c285f8d1f116a38e5c
gcc 4.9.3-8ubuntu2~14.04

First, I compiled lttng-ust with the "-pedantic" option of gcc to verify that this causes an array
of compilation errors.

sboisvert at Z1:~/lttng-ust$ ./bootstrap
sboisvert at Z1:~/lttng-ust$ ./configure --prefix=$HOME/lttng-ust.build
sboisvert at Z1:~/lttng-ust$ make CFLAGS="-pedantic" &> log
sboisvert at 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 at Z1:~/lttng-ust$ patch -p1 < ~/lttng-ust-empty-array.patch 
patching file include/lttng/ust-tracepoint-event.h

sboisvert at Z1:~/lttng-ust$ make CFLAGS="-pedantic" &> log
sboisvert at 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
============================================================================


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


             reply	other threads:[~2016-05-30 18:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-30 18:08 Sebastien Boisvert [this message]
2016-05-31  9:36 ` Mathieu Desnoyers
  -- strict thread matches above, loose matches on Subject: below --
2016-05-30 16:56 Mathieu Desnoyers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=574C8196.8020508@gydle.com \
    --to=sboisvert@gydle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox