This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
How to access g_probe_timing
- From: Arkady <larytet at gmail dot com>
- To: systemtap at sourceware dot org
- Date: Wed, 25 Jan 2017 10:42:45 +0200
- Subject: How to access g_probe_timing
- Authentication-results: sourceware.org; auth=none
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.