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]

How to access g_probe_timing


Hi,

I would like to expose the collected statistics via sysfs or proc.
I have added a C function to my script  which looks like this

%{
static ssize_t stp_stat_show(struct device *dev,
                          struct device_attribute *attr,
                          char *buf)
{
int res;
#ifdef STP_TIMING
int i;
for (i = 0;i < STP_PROBE_COUNT;i++)
{
Stat *stat = &g_probe_timing[i];
struct Hist *hist = stat->hist;
stat_data *agg = stat->agg;
stat_data *sd = stat->sd;
}
res = snprintf(buf, PAGE_SIZE, "STP_TIMING is defined\n");
return res;
#else
res = snprintf(buf, PAGE_SIZE, "STP_TIMING is not defined. Do you run
stap with -t?\n");
return res;
#endif
}
%}
The build fails with "error: 'g_probe_timing' undeclared"

Is there an example of how I can access the collected performance data?
Thank you.


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