Linux-Trace-Devel Archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Sang QianLong <hacksonsang@gmail.com>
Cc: Linux Trace Devel <linux-trace-devel@vger.kernel.org>,
	"linux-trace-users@vger.kernel.org" 
	<linux-trace-users@vger.kernel.org>
Subject: Re: [Issue of trace-cmd] undefined symbol when import ctracecmd.so in python
Date: Fri, 28 Jul 2023 19:36:09 -0400	[thread overview]
Message-ID: <20230728193609.79e91e44@rorschach.local.home> (raw)
In-Reply-To: <CANF=BhZScysm9BchEFytPgOFR4Gx-jeeOV6VpbKnAHZ102onSQ@mail.gmail.com>


I'm Cc'ing the trace users and devel mailing list just to keep this
archived.

On Fri, 28 Jul 2023 11:29:26 +0800
Sang QianLong <hacksonsang@gmail.com> wrote:

> Dear rostedt,
> 
> I hope this email finds you well. My name is Hacksonsang, and I am reaching
> out for your assistance regarding a persistent issue I am facing while
> working with "ctracecmd.so" in Python.
> 

I have to admit that I personally do not use python, and this code was
added by others.

Note, there's patches to fix the python code, but as I'm not a python
expert, I'm still holding off to applying them.

Not sure if this helps you, but you may want to look at this:

  https://patchwork.kernel.org/project/linux-trace-devel/patch/Y+w51nOhNd+PGo/k@slm.duckdns.org/

Does the above help you?

-- Steve


> I am currently using Ubuntu 20.04 with GCC 9.4.0 and Python 3.8.8. The
> problem arises when I try to import "ctracecmd.so" into my Python script. I
> consistently encounter the error message: "Undefined symbol: uncompress."
> 
> To address this, I initially attempted to include the "-lz" flag in
> LD_FLAGS, hoping to resolve the "uncompress" issue. However, this action
> resulted in encountering more "undefined symbol" errors, such as
> "tep_plugin_kvm_get_func."
> Upon investigating further, I found that these symbols are defined in the
> "trace-xxx.c" files within the "tracecmd" directory. Unfortunately, it
> appears that the Python/Makefile only utilizes the ".c" files from the
> "lib/trace-cmd" directory during the compilation of "ctracecmd.so." To
> address this limitation, I tried compiling "ctracecmd.so" by including the
> ".c" files from the "tracecmd" directory using "-fpic" compilation.
> Despite these efforts, I am still facing the same issue, and the "undefined
> symbol" errors persist.
> 
> Given the situation's complexity, I am seeking your expertise and guidance
> in resolving this matter. I believe that resolving this problem is crucial
> as the functionalities offered by trace-cmd are vital for the successful
> execution of my project.
> 
> If there are any specific steps or configurations that I missed or any
> other troubleshooting suggestions you could provide, I would greatly
> appreciate it. Please let me know if you require any additional
> information, logs, or code snippets to understand the issue better. I am
> willing to provide whatever is necessary for a comprehensive analysis.
> 
> Thank you so much for your time and consideration. I am eagerly looking
> forward to your valuable insights and assistance.
> 
> Best regards


       reply	other threads:[~2023-07-28 23:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CANF=BhZScysm9BchEFytPgOFR4Gx-jeeOV6VpbKnAHZ102onSQ@mail.gmail.com>
2023-07-28 23:36 ` Steven Rostedt [this message]
     [not found]   ` <CANF=BhYAbU+sLYxpaRVA=m0_jgJFr0c+JAAx+HQ4FcTkuSnB7w@mail.gmail.com>
2023-08-02 13:47     ` [Issue of trace-cmd] undefined symbol when import ctracecmd.so in python Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230728193609.79e91e44@rorschach.local.home \
    --to=rostedt@goodmis.org \
    --cc=hacksonsang@gmail.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=linux-trace-users@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).