aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2010-04-03 18:17:55 +0200
committerIngo Molnar <mingo@elte.hu>2010-04-03 18:17:55 +0200
commit22a4e4c435bbc0edccc2e7e5143ce4fbe9679e2d (patch)
tree9981477f6f9e4527a9598e636d0ffc7705a322a4 /tools/perf/util
parent70a7c1271e2bfca8ad2bf71f44c516ea2763b9ed (diff)
parent6e03bb5ad363fdbe4e1e227cfb78f7978c662e18 (diff)
downloadkernel_samsung_smdk4412-22a4e4c435bbc0edccc2e7e5143ce4fbe9679e2d.tar.gz
kernel_samsung_smdk4412-22a4e4c435bbc0edccc2e7e5143ce4fbe9679e2d.tar.bz2
kernel_samsung_smdk4412-22a4e4c435bbc0edccc2e7e5143ce4fbe9679e2d.zip
Merge branch 'perf/urgent' into perf/core
Conflicts: tools/perf/Makefile Merge reason: resolve the conflict. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util')
-rw-r--r--tools/perf/util/scripting-engines/trace-event-python.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c
index 33a414bbba3..6a72f14c598 100644
--- a/tools/perf/util/scripting-engines/trace-event-python.c
+++ b/tools/perf/util/scripting-engines/trace-event-python.c
@@ -208,7 +208,7 @@ static void python_process_event(int cpu, void *data,
int size __unused,
unsigned long long nsecs, char *comm)
{
- PyObject *handler, *retval, *context, *t;
+ PyObject *handler, *retval, *context, *t, *obj;
static char handler_name[256];
struct format_field *field;
unsigned long long val;
@@ -256,16 +256,23 @@ static void python_process_event(int cpu, void *data,
offset &= 0xffff;
} else
offset = field->offset;
- PyTuple_SetItem(t, n++,
- PyString_FromString((char *)data + offset));
+ obj = PyString_FromString((char *)data + offset);
} else { /* FIELD_IS_NUMERIC */
val = read_size(data + field->offset, field->size);
if (field->flags & FIELD_IS_SIGNED) {
- PyTuple_SetItem(t, n++, PyInt_FromLong(val));
+ if ((long long)val >= LONG_MIN &&
+ (long long)val <= LONG_MAX)
+ obj = PyInt_FromLong(val);
+ else
+ obj = PyLong_FromLongLong(val);
} else {
- PyTuple_SetItem(t, n++, PyInt_FromLong(val));
+ if (val <= LONG_MAX)
+ obj = PyInt_FromLong(val);
+ else
+ obj = PyLong_FromUnsignedLongLong(val);
}
}
+ PyTuple_SetItem(t, n++, obj);
}
if (_PyTuple_Resize(&t, n) == -1)