public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Franck Bui-Huu <vagabon.xyz@gmail.com>
To: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] perf-probe: no need to initialize the entire temporary buffers in synthesize_perf_probe_point()
Date: Thu, 23 Dec 2010 16:27:57 +0100	[thread overview]
Message-ID: <m3wrn07blu.fsf@gmail.com> (raw)

From: Franck Bui-Huu <fbuihuu@gmail.com>

This patches only put a single null byte at the beginning of each
temporary buffers line[], offs[], file[] instead of filling their full
contents with null bytes.

Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
---
 tools/perf/util/probe-event.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index adc2620..e453f13 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -1058,9 +1058,11 @@ error:
 static char *synthesize_perf_probe_point(struct perf_probe_point *pp)
 {
 	char *buf, *tmp;
-	char offs[32] = "", line[32] = "", file[32] = "";
+	char offs[32], line[32], file[32];
 	int ret, len;
 
+	offs[0] = line[0] = file[0] = '\0';
+
 	buf = zalloc(MAX_CMDLEN);
 	if (buf == NULL) {
 		ret = -ENOMEM;
-- 
1.7.3.2


             reply	other threads:[~2010-12-23 15:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-23 15:27 Franck Bui-Huu [this message]
2010-12-24  4:46 ` [PATCH] perf-probe: no need to initialize the entire temporary buffers in synthesize_perf_probe_point() Masami Hiramatsu
2010-12-24 13:14   ` Arnaldo Carvalho de Melo
2010-12-27 21:06     ` Franck Bui-Huu
2010-12-27 21:01   ` Franck Bui-Huu

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=m3wrn07blu.fsf@gmail.com \
    --to=vagabon.xyz@gmail.com \
    --cc=acme@ghostprotocols.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.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
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