Discussion:
Problem in loading a python plugin for trace-cmd tool
Xenia Ragiadakou
2013-08-15 00:20:24 UTC
Permalink
Hi Steven,

I have written a plugin in python for parsing the tracing output of some
xhci events and i have placed it under the
lib/trace-cmd/plugins directory. When i do "trace-cmd report", the
plugin is loaded successfully, the corresponding .pyc file is created
under the lib/trace-cmd/plugins directory and the tracing output is
displayed as expected.
However, when Sarah follows the same steps, the plugin is not loaded, no
.pyc file is created and the printed output is the default.

I do not remember to have changed anything in the trace-cmd source code
that i downloaded from your repo.
Do you have any idea why this happens? Is there another place where the
xhci python plugin shall be placed, in order to be loaded successfully?

best regards,
ksenia
--
To unsubscribe from this list: send the line "unsubscribe linux-trace-users" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Steven Rostedt
2013-08-15 00:52:05 UTC
Permalink
On Thu, 15 Aug 2013 03:20:24 +0300
Post by Xenia Ragiadakou
Hi Steven,
I have written a plugin in python for parsing the tracing output of some
xhci events and i have placed it under the
lib/trace-cmd/plugins directory. When i do "trace-cmd report", the
plugin is loaded successfully, the corresponding .pyc file is created
under the lib/trace-cmd/plugins directory and the tracing output is
displayed as expected.
However, when Sarah follows the same steps, the plugin is not loaded, no
.pyc file is created and the printed output is the default.
I do not remember to have changed anything in the trace-cmd source code
that i downloaded from your repo.
Do you have any idea why this happens? Is there another place where the
xhci python plugin shall be placed, in order to be loaded successfully?
Hi Ksenia (BTW, do you prefer to be called "Ksenia" as that's what you
sign your emails with, or should I be referring to you as "Xenia"?)

Believe it or not, I don't do python ;-) The python code was created
by Darren Hart and Johannes Berg (both Cc'd). They would be better at
answering your question.

-- Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-trace-users" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Xenia Ragiadakou
2013-08-15 01:23:58 UTC
Permalink
Post by Steven Rostedt
On Thu, 15 Aug 2013 03:20:24 +0300
Post by Xenia Ragiadakou
Hi Steven,
I have written a plugin in python for parsing the tracing output of some
xhci events and i have placed it under the
lib/trace-cmd/plugins directory. When i do "trace-cmd report", the
plugin is loaded successfully, the corresponding .pyc file is created
under the lib/trace-cmd/plugins directory and the tracing output is
displayed as expected.
However, when Sarah follows the same steps, the plugin is not loaded, no
.pyc file is created and the printed output is the default.
I do not remember to have changed anything in the trace-cmd source code
that i downloaded from your repo.
Do you have any idea why this happens? Is there another place where the
xhci python plugin shall be placed, in order to be loaded successfully?
Hi Ksenia (BTW, do you prefer to be called "Ksenia" as that's what you
sign your emails with, or should I be referring to you as "Xenia"?)
It is pronounced Ksenia, but its full version in latin alphabet is Polyxeni.
Since 'x' is pronounced differently in english depending on its place in
the word, i am also confused :)
Post by Steven Rostedt
Believe it or not, I don't do python ;-) The python code was created
by Darren Hart and Johannes Berg (both Cc'd). They would be better at
answering your question.
-- Steve
I did not do Python either, but i would never do the parsing in C :)
Thanks for CC 'ing Darren Hart and Johannes Berg, i should have thought
of that.

best regards,
ksenia
--
To unsubscribe from this list: send the line "unsubscribe linux-trace-users" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Johannes Berg
2013-08-15 06:21:18 UTC
Permalink
Hi,
Post by Xenia Ragiadakou
I have written a plugin in python for parsing the tracing output of some
xhci events and i have placed it under the
lib/trace-cmd/plugins directory. When i do "trace-cmd report", the
plugin is loaded successfully, the corresponding .pyc file is created
under the lib/trace-cmd/plugins directory and the tracing output is
displayed as expected.
That does seem like the correct place, and since it works for you ... :)
Post by Xenia Ragiadakou
However, when Sarah follows the same steps, the plugin is not loaded, no
.pyc file is created and the printed output is the default.
Sarah, it sounds like you might not have the python plugin installed. I
know of no distro, for example, that ships the python plugin today, so I
run into this issue a lot. Or, if you did, you probably didn't have
python-dev and/or swig installed when building (though I think if you
have python-dev but not swig it actually errors out, but when you don't
have python-dev it skips python.)
Post by Xenia Ragiadakou
I do not remember to have changed anything in the trace-cmd source code
that i downloaded from your repo.
But you probably compiled and installed it, right?

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-trace-users" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Sarah Sharp
2013-08-15 16:21:14 UTC
Permalink
Post by Johannes Berg
Hi,
Post by Xenia Ragiadakou
I have written a plugin in python for parsing the tracing output of some
xhci events and i have placed it under the
lib/trace-cmd/plugins directory. When i do "trace-cmd report", the
plugin is loaded successfully, the corresponding .pyc file is created
under the lib/trace-cmd/plugins directory and the tracing output is
displayed as expected.
That does seem like the correct place, and since it works for you ... :)
Post by Xenia Ragiadakou
However, when Sarah follows the same steps, the plugin is not loaded, no
.pyc file is created and the printed output is the default.
Sarah, it sounds like you might not have the python plugin installed. I
know of no distro, for example, that ships the python plugin today, so I
run into this issue a lot. Or, if you did, you probably didn't have
python-dev and/or swig installed when building (though I think if you
have python-dev but not swig it actually errors out, but when you don't
have python-dev it skips python.)
I installed trace-cmd after building it from the latest repo. However,
I didn't have python-dev installed, so I think that's the problem. I'll
work with Darren and get Xenia's instructions for installing her xhci
plugin updated once I figure out what's wrong.

Sarah Sharp
--
To unsubscribe from this list: send the line "unsubscribe linux-trace-users" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Loading...