Messages in this thread | | | Subject | Re: perf: store and retrieve trace event names in the perf.data file | From | Peter Zijlstra <> | Date | Mon, 10 Aug 2009 11:50:05 +0200 |
| |
Thanks for the CC :-)
On Sun, 2009-08-09 at 14:49 -0700, Arjan van de Ven wrote: > +static void store_event_type(const char *orgname) > +{ > + char filename[PATH_MAX], *c; > + FILE *file; > + int id; > + > + sprintf(filename, "/sys/kernel/debug/tracing/events/%s/id", orgname);
That should be using debugfs_path, as it stands this thing won't work on any of my machines.
> + c = strchr(filename, ':'); > + if (c) *c = '/'; > + > + file = fopen(filename, "r"); > + if (!file) > + return; > + fscanf(file, "%i", &id); > + fclose(file); > + perf_header__push_event(id, orgname); > +}
| |