[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1249897805.17467.77.camel@twins>
Date: Mon, 10 Aug 2009 11:50:05 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Arjan van de Ven <arjan@...ux.intel.com>
Cc: Ingo Molnar <mingo@...e.hu>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: perf: store and retrieve trace event names in the perf.data
file
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists