Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 182474
b: refs/heads/master
c: 44ad9cd
h: refs/heads/master
v: v3
  • Loading branch information
Tom Zanussi authored and Frederic Weisbecker committed Feb 25, 2010
1 parent d45d028 commit a7ee2af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4d161f0360d00d46a89827b3fd6da395f00c5d90
refs/heads/master: 44ad9cd8f0893b9ae0ac729a7dc2a1ebcd170ac6
13 changes: 5 additions & 8 deletions trunk/tools/perf/util/scripting-engines/trace-event-python.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ static void define_value(enum print_arg_type field_type,
if (field_type == PRINT_SYMBOL)
handler_name = "define_symbolic_value";

t = PyTuple_New(MAX_FIELDS);
t = PyTuple_New(4);
if (!t)
Py_FatalError("couldn't create Python tuple");

Expand All @@ -79,9 +79,6 @@ static void define_value(enum print_arg_type field_type,
PyTuple_SetItem(t, n++, PyInt_FromLong(value));
PyTuple_SetItem(t, n++, PyString_FromString(field_str));

if (_PyTuple_Resize(&t, n) == -1)
Py_FatalError("error resizing Python tuple");

handler = PyDict_GetItemString(main_dict, handler_name);
if (handler && PyCallable_Check(handler)) {
retval = PyObject_CallObject(handler, t);
Expand Down Expand Up @@ -116,7 +113,10 @@ static void define_field(enum print_arg_type field_type,
if (field_type == PRINT_SYMBOL)
handler_name = "define_symbolic_field";

t = PyTuple_New(MAX_FIELDS);
if (field_type == PRINT_FLAGS)
t = PyTuple_New(3);
else
t = PyTuple_New(2);
if (!t)
Py_FatalError("couldn't create Python tuple");

Expand All @@ -125,9 +125,6 @@ static void define_field(enum print_arg_type field_type,
if (field_type == PRINT_FLAGS)
PyTuple_SetItem(t, n++, PyString_FromString(delim));

if (_PyTuple_Resize(&t, n) == -1)
Py_FatalError("error resizing Python tuple");

handler = PyDict_GetItemString(main_dict, handler_name);
if (handler && PyCallable_Check(handler)) {
retval = PyObject_CallObject(handler, t);
Expand Down

0 comments on commit a7ee2af

Please sign in to comment.