aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/perf
diff options
context:
space:
mode:
authorSimon Horman <horms+renesas@verge.net.au>2013-12-19 17:14:25 +0900
committerSimon Horman <horms+renesas@verge.net.au>2013-12-19 17:14:25 +0900
commit236573d2405d6b9fa5395d14731c2ec2f8cb8f4f (patch)
treeff261b48f83b55785d146a36d88fa2a51479e247 /tools/perf
parentMerge remote-tracking branch 'daniel-lezcano/clockevents/for-Simon-3.13-rc2' into dt3-base (diff)
parentLinux 3.13-rc3 (diff)
downloadwireguard-linux-236573d2405d6b9fa5395d14731c2ec2f8cb8f4f.tar.xz
wireguard-linux-236573d2405d6b9fa5395d14731c2ec2f8cb8f4f.zip
Merge tag 'v3.13-rc3' into dt3-base
Linux 3.13-rc3 Conflicts: drivers/pinctrl/sh-pfc/pfc-r8a7740.c drivers/pinctrl/sh-pfc/pfc-sh7372.c
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/util/header.c6
-rw-r--r--tools/perf/util/thread.c11
2 files changed, 9 insertions, 8 deletions
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 369c03648f88..1cd035708931 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -2078,8 +2078,10 @@ static int process_group_desc(struct perf_file_section *section __maybe_unused,
if (evsel->idx == (int) desc[i].leader_idx) {
evsel->leader = evsel;
/* {anon_group} is a dummy name */
- if (strcmp(desc[i].name, "{anon_group}"))
+ if (strcmp(desc[i].name, "{anon_group}")) {
evsel->group_name = desc[i].name;
+ desc[i].name = NULL;
+ }
evsel->nr_members = desc[i].nr_members;
if (i >= nr_groups || nr > 0) {
@@ -2105,7 +2107,7 @@ static int process_group_desc(struct perf_file_section *section __maybe_unused,
ret = 0;
out_free:
- while ((int) --i >= 0)
+ for (i = 0; i < nr_groups; i++)
free(desc[i].name);
free(desc);
diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c
index cd8e2f592719..49eaf1d7d89d 100644
--- a/tools/perf/util/thread.c
+++ b/tools/perf/util/thread.c
@@ -70,14 +70,13 @@ int thread__set_comm(struct thread *thread, const char *str, u64 timestamp)
/* Override latest entry if it had no specific time coverage */
if (!curr->start) {
comm__override(curr, str, timestamp);
- return 0;
+ } else {
+ new = comm__new(str, timestamp);
+ if (!new)
+ return -ENOMEM;
+ list_add(&new->list, &thread->comm_list);
}
- new = comm__new(str, timestamp);
- if (!new)
- return -ENOMEM;
-
- list_add(&new->list, &thread->comm_list);
thread->comm_set = true;
return 0;