How to access g_probe_timing
Arkady
larytet@gmail.com
Wed Jan 25 08:43:00 GMT 2017
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.
More information about the Systemtap
mailing list