This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [PATCH] don't generate empty struct global
- From: Wenji Huang <wenji dot huang at oracle dot com>
- To: Josh Stone <jistone at redhat dot com>
- Cc: SystemTAP <systemtap at sources dot redhat dot com>
- Date: Tue, 24 Feb 2009 09:24:56 +0800
- Subject: Re: [PATCH] don't generate empty struct global
- References: <49A26F8E.9070003@oracle.com> <49A3011F.7000709@redhat.com>
- Reply-to: wenji dot huang at oracle dot com
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