lkml.org 
[lkml]   [2010]   [Dec]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] perf-probe: no need to initialize the entire temporary buffers in synthesize_perf_probe_point()
Date
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


\
 
 \ /
  Last update: 2010-12-23 16:31    [W:0.061 / U:0.528 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site