Re: perf: store and retrieve trace event names in the perf.datafile

From: Peter Zijlstra
Date: Mon Aug 10 2009 - 05:50:34 EST


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);
> +}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/