Linux-Trace-Devel Archive on lore.kernel.org
 help / color / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>
Cc: linux-trace-devel@vger.kernel.org
Subject: Re: [PATCH v2 0/3] Initial trace-cmd support for ftrace uprobes
Date: Wed, 16 Sep 2020 21:07:21 -0400
Message-ID: <20200916210721.6994f7ab@rorschach.local.home> (raw)
In-Reply-To: <20200916114709.291533-1-tz.stoyanov@gmail.com>

Hi Tzvetomir,

I really like this patch set. Great job!

To get it working on my laptop, I had to make the following changes. I
ran this on a new VM which didn't have libbfd and it failed to build.
Then the check wasn't quite working, and it was saying that libbfd
wasn't installed even though it was. Finally, I tested it against a
small program that had numbers in the function name, and I had to
change your sanitizer to not convert numbers into underscores.

Also, all strdup()s need to be tested. But other than that, it looks
great!

Below is the changes I made.

-- Steve

diff --git a/Makefile b/Makefile
index 0d657969..240043e1 100644
--- a/Makefile
+++ b/Makefile
@@ -245,7 +245,7 @@ endif
 CUNIT_INSTALLED := $(shell if (printf "$(pound)include <CUnit/Basic.h>\n void main(){CU_initialize_registry();}" | $(CC) -x c - -lcunit >/dev/null 2>&1) ; then echo 1; else echo 0 ; fi)
 export CUNIT_INSTALLED
 
-BFD_INSTALLED := $(shell if (echo -e "\#include <bfd.h>\n void main(){bfd_init();}" | $(CC) -xc  - -lbfd >/dev/null 2>&1) ; then echo 1; else echo 0 ; fi)
+BFD_INSTALLED := $(shell if (printf "$(pound)include <bfd.h>\n void main(){bfd_init();}" | $(CC) -x c  - -lbfd >/dev/null 2>&1) ; then echo 1; else echo 0 ; fi)
 
 export BFD_INSTALLED
 ifeq ($(BFD_INSTALLED), 1)
diff --git a/tracecmd/trace-obj-debug.c b/tracecmd/trace-obj-debug.c
index 93b0dfee..254bfb38 100644
--- a/tracecmd/trace-obj-debug.c
+++ b/tracecmd/trace-obj-debug.c
@@ -8,13 +8,13 @@
 #include <string.h>
 #include <limits.h>
 #include <errno.h>
-#include <bfd.h>
 #include <unistd.h>
 
 #include "trace-local.h"
 #include "trace-cmd.h"
 
 #ifdef BFD_INSTALLED
+#include <bfd.h>
 
 struct trace_debug_handle {
 	bfd *bfd;
diff --git a/tracecmd/trace-uprobes.c b/tracecmd/trace-uprobes.c
index 87f8c148..75bebd6f 100644
--- a/tracecmd/trace-uprobes.c
+++ b/tracecmd/trace-uprobes.c
@@ -31,7 +31,7 @@ static char *uprobe_event_name(char *file, char *func, bool pret)
 	asprintf(&event, "%c_%.*s_%.10s", pret ? 'r':'p', 10, fname, func);
 	if (event) {
 		for (i = 0; event[i]; i++) {
-			if (!isalpha(event[i]))
+			if (!isalnum(event[i]))
 				event[i] = '_';
 		}
 	}

  parent reply index

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-16 11:47 Tzvetomir Stoyanov (VMware)
2020-09-16 11:47 ` [PATCH v2 1/3] trace-cmd: Internal refactoring of pid address map logic Tzvetomir Stoyanov (VMware)
2020-09-16 11:47 ` [PATCH v2 2/3] trace-cmd: New internal APIs for reading ELF header Tzvetomir Stoyanov (VMware)
2020-09-17 13:42   ` Steven Rostedt
2020-09-16 11:47 ` [PATCH v2 3/3] trace-cmd: [POC] Add support for uprobes Tzvetomir Stoyanov (VMware)
2020-09-16 13:26 ` [PATCH v2 0/3] Initial trace-cmd support for ftrace uprobes Steven Rostedt
2020-09-17  1:07 ` Steven Rostedt [this message]
2020-09-24  7:14 Tzvetomir Stoyanov (VMware)

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=20200916210721.6994f7ab@rorschach.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=tz.stoyanov@gmail.com \
    /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

Linux-Trace-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-trace-devel/0 linux-trace-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-trace-devel linux-trace-devel/ https://lore.kernel.org/linux-trace-devel \
		linux-trace-devel@vger.kernel.org
	public-inbox-index linux-trace-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-trace-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git