This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] don't generate empty struct global


Josh Stone wrote:
Wenji Huang wrote:
Impact: clean up

struct global will keep the defined global variables. It will be generated but no reference even no global variables. like,

static struct {
} global = {

};

Have you seen any actual impact of keeping this? It doesn't seem to be included in the final module as far as I can see.


Thanks for your review.
I do find the empty struct in generated C file.

$stap -p4 -k -vve 'probe begin{}'
...
static void *contexts = NULL; /* alloc_percpu */


static struct { } global = {

};

#ifdef STP_TIMING
static __cacheline_aligned Stat time_probe_0;
#endif
...
This patch will skip the struct if no global variable.

That said, your change looks fine to me. Just tweak it to follow the GNU coding style please.


  if (...)
    {
      ...
    }



Josh

oh, I forgot to add some indents.

Regards,
Wenji


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]