diff options
author | Ingo Molnar <mingo@kernel.org> | 2012-11-13 12:51:51 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2012-11-13 12:51:51 -0500 |
commit | 18423d3562f396206e0928a71177eeb2edfed077 (patch) | |
tree | 844cabbae20e511912261ca2ad3ece33852e5bd3 | |
parent | 0d855354ea351bec6b222e9fea86a876cfafdcb6 (diff) | |
parent | f787d9519fb10411f2948f5b9957a1669879ba84 (diff) |
Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
Pull perf/urgent fixes from Arnaldo Carvalho de Melo:
* Fix numa topology printing, from Namhyung Kim.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | tools/perf/util/header.c | 2 | ||||
-rw-r--r-- | tools/perf/util/strbuf.c | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 7daad237dea..566b84c695c 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c | |||
@@ -1378,6 +1378,8 @@ static void print_numa_topology(struct perf_header *ph, int fd __maybe_unused, | |||
1378 | 1378 | ||
1379 | str = tmp + 1; | 1379 | str = tmp + 1; |
1380 | fprintf(fp, "# node%u cpu list : %s\n", c, str); | 1380 | fprintf(fp, "# node%u cpu list : %s\n", c, str); |
1381 | |||
1382 | str += strlen(str) + 1; | ||
1381 | } | 1383 | } |
1382 | return; | 1384 | return; |
1383 | error: | 1385 | error: |
diff --git a/tools/perf/util/strbuf.c b/tools/perf/util/strbuf.c index 2eeb51baf07..cfa906882e2 100644 --- a/tools/perf/util/strbuf.c +++ b/tools/perf/util/strbuf.c | |||
@@ -90,17 +90,17 @@ void strbuf_addf(struct strbuf *sb, const char *fmt, ...) | |||
90 | if (!strbuf_avail(sb)) | 90 | if (!strbuf_avail(sb)) |
91 | strbuf_grow(sb, 64); | 91 | strbuf_grow(sb, 64); |
92 | va_start(ap, fmt); | 92 | va_start(ap, fmt); |
93 | len = vscnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, ap); | 93 | len = vsnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, ap); |
94 | va_end(ap); | 94 | va_end(ap); |
95 | if (len < 0) | 95 | if (len < 0) |
96 | die("your vscnprintf is broken"); | 96 | die("your vsnprintf is broken"); |
97 | if (len > strbuf_avail(sb)) { | 97 | if (len > strbuf_avail(sb)) { |
98 | strbuf_grow(sb, len); | 98 | strbuf_grow(sb, len); |
99 | va_start(ap, fmt); | 99 | va_start(ap, fmt); |
100 | len = vscnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, ap); | 100 | len = vsnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, ap); |
101 | va_end(ap); | 101 | va_end(ap); |
102 | if (len > strbuf_avail(sb)) { | 102 | if (len > strbuf_avail(sb)) { |
103 | die("this should not happen, your snprintf is broken"); | 103 | die("this should not happen, your vsnprintf is broken"); |
104 | } | 104 | } |
105 | } | 105 | } |
106 | strbuf_setlen(sb, sb->len + len); | 106 | strbuf_setlen(sb, sb->len + len); |