Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1297518
| From | Jiri Olsa <jolsa@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 7/8] perf script: Add python support for stat events |
| Date | 2015-12-23 17:10 +0100 |
| Message-ID | <qIU9b-3q8-7@gated-at.bofh.it> (permalink) |
| References | <qIxmi-5MK-3@gated-at.bofh.it> <qIxmi-5MK-5@gated-at.bofh.it> <qIRXH-1Sp-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed, Dec 23, 2015 at 10:42:47PM +0900, Namhyung Kim wrote:
SNIP
> > +static void
> > +process_stat(struct perf_evsel *counter, int cpu, int thread, u64 time,
> > + struct perf_counts_values *count)
> > +{
> > + PyObject *handler, *t;
> > + static char handler_name[256];
> > + int n = 0;
> > +
> > + t = PyTuple_New(MAX_FIELDS);
> > + if (!t)
> > + Py_FatalError("couldn't create Python tuple");
> > +
> > + get_handler_name(handler_name, sizeof(handler_name),
> > + counter);
> > +
> > + handler = get_handler(handler_name);
> > + if (!handler) {
> > + pr_debug("can't find python handler %s\n", handler_name);
> > + return;
> > + }
> > +
> > + PyTuple_SetItem(t, n++, PyInt_FromLong(cpu));
> > + PyTuple_SetItem(t, n++, PyInt_FromLong(thread));
> > + PyTuple_SetItem(t, n++, PyLong_FromLong(time));
> > + PyTuple_SetItem(t, n++, PyLong_FromLong(count->val));
> > + PyTuple_SetItem(t, n++, PyLong_FromLong(count->ena));
> > + PyTuple_SetItem(t, n++, PyLong_FromLong(count->run));
>
> What about 32-bit systems? It seems the PyLong_FromLong() takes long
> but the counts are u64.
hum, if it does I think we'll have problems in other
parts of python code.. I'll check, thanks
jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCHv7 00/25] perf stat: Add scripting support Jiri Olsa <jolsa@kernel.org> - 2015-12-22 16:50 +0100
[PATCH 7/8] perf script: Add python support for stat events Jiri Olsa <jolsa@kernel.org> - 2015-12-22 16:50 +0100
Re: [PATCH 7/8] perf script: Add python support for stat events Namhyung Kim <namhyung@kernel.org> - 2015-12-23 14:50 +0100
Re: [PATCH 7/8] perf script: Add python support for stat events Jiri Olsa <jolsa@redhat.com> - 2015-12-23 17:10 +0100
[PATCH 1/8] perf stat record: Keep sample_type 0 for pipe session Jiri Olsa <jolsa@kernel.org> - 2015-12-22 16:50 +0100
[PATCH 2/8] perf script: Process cpu/threads maps Jiri Olsa <jolsa@kernel.org> - 2015-12-22 16:50 +0100
[PATCH 8/8] perf script: Add stat-cpi.py script Jiri Olsa <jolsa@kernel.org> - 2015-12-22 16:50 +0100
Re: [PATCH 8/8] perf script: Add stat-cpi.py script Namhyung Kim <namhyung@kernel.org> - 2015-12-23 14:50 +0100
Re: [PATCH 8/8] perf script: Add stat-cpi.py script Jiri Olsa <jolsa@redhat.com> - 2015-12-23 17:10 +0100
[PATCH 6/8] perf script: Display stat events by default Jiri Olsa <jolsa@kernel.org> - 2015-12-22 16:50 +0100
[PATCH 4/8] perf script: Add process_stat/process_stat_interval scripting interface Jiri Olsa <jolsa@kernel.org> - 2015-12-22 16:50 +0100
[PATCH 5/8] perf script: Add stat default handlers Jiri Olsa <jolsa@kernel.org> - 2015-12-22 16:50 +0100
Re: [PATCH 5/8] perf script: Add stat default handlers Namhyung Kim <namhyung@kernel.org> - 2015-12-23 14:50 +0100
Re: [PATCH 5/8] perf script: Add stat default handlers Jiri Olsa <jolsa@redhat.com> - 2015-12-23 17:10 +0100
Re: [PATCHv7 00/25] perf stat: Add scripting support Jiri Olsa <jolsa@redhat.com> - 2015-12-22 17:00 +0100
csiph-web