[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <52899B3E.9050901@gmail.com>
Date: Sun, 17 Nov 2013 21:44:46 -0700
From: David Ahern <dsahern@...il.com>
To: Namhyung Kim <namhyung@...nel.org>,
Arnaldo Carvalho de Melo <acme@...stprotocols.net>
CC: Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Paul Mackerras <paulus@...ba.org>,
Ingo Molnar <mingo@...nel.org>,
Namhyung Kim <namhyung.kim@....com>,
LKML <linux-kernel@...r.kernel.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Jiri Olsa <jolsa@...hat.com>
Subject: Re: [RFC/PATCH 2/3] perf script: Print comm, fork and exit events
also
On 11/17/13, 8:00 PM, Namhyung Kim wrote:
> @@ -578,6 +579,106 @@ static int process_attr(struct perf_tool *tool, union perf_event *event,
> return perf_evsel__check_attr(evsel, scr->session);
> }
>
> +static int process_comm_event(struct perf_tool *tool,
> + union perf_event *event,
> + struct perf_sample *sample,
> + struct machine *machine)
> +{
> + struct thread *thread;
> + struct perf_script *script = container_of(tool, struct perf_script, tool);
> + struct perf_session *session = script->session;
> + struct perf_evsel *evsel = perf_evlist__first(session->evlist);
> + char *oldname;
> +
> + thread = machine__findnew_thread(machine, event->comm.pid, event->comm.tid);
> + if (thread == NULL) {
> + pr_debug("problem processing COMM event, skipping it.\n");
> + return -1;
> + }
> +
> + oldname = strdup(thread__comm_str(thread));
> + if (oldname == NULL) {
> + pr_debug("problem processing COMM event, skipping it.\n");
> + return -1;
> + }
> +
> + if (perf_event__process_comm(tool, event, sample, machine) < 0)
> + return -1;
> +
> + if (!evsel->attr.sample_id_all) {
> + sample->cpu = 0;
> + sample->time = 0;
> + sample->tid = event->comm.tid;
> + sample->pid = event->comm.pid;
> + }
> + print_sample_start(sample, thread, evsel);
> + printf("comm: %s --> %s\n", oldname, event->comm.comm);
free(oldname)
David
--
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