aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2014-01-17 17:01:27 -0500
committerRob Herring <robh@kernel.org>2014-01-17 17:01:27 -0500
commit361128fcbf30f590a05c8e8789155364f37367db (patch)
tree7f7973599e286dfd48ea724a5b7fb4bca76b294e /tools
parente2897d7e0b0460dca91b52d55ce41c888363502d (diff)
parent482c43419fc204b4b658fa4acb80cd502e5fcbac (diff)
Merge remote-tracking branch 'grant/devicetree/next' into for-3.14
Diffstat (limited to 'tools')
-rw-r--r--tools/lib/traceevent/event-parse.c25
-rw-r--r--tools/perf/util/header.c6
-rw-r--r--tools/perf/util/thread.c11
-rw-r--r--tools/power/cpupower/utils/cpupower-set.c6
-rw-r--r--tools/usb/Makefile5
5 files changed, 37 insertions, 16 deletions
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index 0362d575de7d..217c82ee3665 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -1606,6 +1606,24 @@ process_arg(struct event_format *event, struct print_arg *arg, char **tok)
1606static enum event_type 1606static enum event_type
1607process_op(struct event_format *event, struct print_arg *arg, char **tok); 1607process_op(struct event_format *event, struct print_arg *arg, char **tok);
1608 1608
1609/*
1610 * For __print_symbolic() and __print_flags, we need to completely
1611 * evaluate the first argument, which defines what to print next.
1612 */
1613static enum event_type
1614process_field_arg(struct event_format *event, struct print_arg *arg, char **tok)
1615{
1616 enum event_type type;
1617
1618 type = process_arg(event, arg, tok);
1619
1620 while (type == EVENT_OP) {
1621 type = process_op(event, arg, tok);
1622 }
1623
1624 return type;
1625}
1626
1609static enum event_type 1627static enum event_type
1610process_cond(struct event_format *event, struct print_arg *top, char **tok) 1628process_cond(struct event_format *event, struct print_arg *top, char **tok)
1611{ 1629{
@@ -2371,7 +2389,7 @@ process_flags(struct event_format *event, struct print_arg *arg, char **tok)
2371 goto out_free; 2389 goto out_free;
2372 } 2390 }
2373 2391
2374 type = process_arg(event, field, &token); 2392 type = process_field_arg(event, field, &token);
2375 2393
2376 /* Handle operations in the first argument */ 2394 /* Handle operations in the first argument */
2377 while (type == EVENT_OP) 2395 while (type == EVENT_OP)
@@ -2424,7 +2442,8 @@ process_symbols(struct event_format *event, struct print_arg *arg, char **tok)
2424 goto out_free; 2442 goto out_free;
2425 } 2443 }
2426 2444
2427 type = process_arg(event, field, &token); 2445 type = process_field_arg(event, field, &token);
2446
2428 if (test_type_token(type, token, EVENT_DELIM, ",")) 2447 if (test_type_token(type, token, EVENT_DELIM, ","))
2429 goto out_free_field; 2448 goto out_free_field;
2430 2449
@@ -3446,7 +3465,7 @@ eval_num_arg(void *data, int size, struct event_format *event, struct print_arg
3446 * is in the bottom half of the 32 bit field. 3465 * is in the bottom half of the 32 bit field.
3447 */ 3466 */
3448 offset &= 0xffff; 3467 offset &= 0xffff;
3449 val = (unsigned long long)(data + offset); 3468 val = (unsigned long long)((unsigned long)data + offset);
3450 break; 3469 break;
3451 default: /* not sure what to do there */ 3470 default: /* not sure what to do there */
3452 return 0; 3471 return 0;
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,
2078 if (evsel->idx == (int) desc[i].leader_idx) { 2078 if (evsel->idx == (int) desc[i].leader_idx) {
2079 evsel->leader = evsel; 2079 evsel->leader = evsel;
2080 /* {anon_group} is a dummy name */ 2080 /* {anon_group} is a dummy name */
2081 if (strcmp(desc[i].name, "{anon_group}")) 2081 if (strcmp(desc[i].name, "{anon_group}")) {
2082 evsel->group_name = desc[i].name; 2082 evsel->group_name = desc[i].name;
2083 desc[i].name = NULL;
2084 }
2083 evsel->nr_members = desc[i].nr_members; 2085 evsel->nr_members = desc[i].nr_members;
2084 2086
2085 if (i >= nr_groups || nr > 0) { 2087 if (i >= nr_groups || nr > 0) {
@@ -2105,7 +2107,7 @@ static int process_group_desc(struct perf_file_section *section __maybe_unused,
2105 2107
2106 ret = 0; 2108 ret = 0;
2107out_free: 2109out_free:
2108 while ((int) --i >= 0) 2110 for (i = 0; i < nr_groups; i++)
2109 free(desc[i].name); 2111 free(desc[i].name);
2110 free(desc); 2112 free(desc);
2111 2113
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)
70 /* Override latest entry if it had no specific time coverage */ 70 /* Override latest entry if it had no specific time coverage */
71 if (!curr->start) { 71 if (!curr->start) {
72 comm__override(curr, str, timestamp); 72 comm__override(curr, str, timestamp);
73 return 0; 73 } else {
74 new = comm__new(str, timestamp);
75 if (!new)
76 return -ENOMEM;
77 list_add(&new->list, &thread->comm_list);
74 } 78 }
75 79
76 new = comm__new(str, timestamp);
77 if (!new)
78 return -ENOMEM;
79
80 list_add(&new->list, &thread->comm_list);
81 thread->comm_set = true; 80 thread->comm_set = true;
82 81
83 return 0; 82 return 0;
diff --git a/tools/power/cpupower/utils/cpupower-set.c b/tools/power/cpupower/utils/cpupower-set.c
index dc4de3762111..bcf1d2f0b791 100644
--- a/tools/power/cpupower/utils/cpupower-set.c
+++ b/tools/power/cpupower/utils/cpupower-set.c
@@ -18,9 +18,9 @@
18#include "helpers/bitmask.h" 18#include "helpers/bitmask.h"
19 19
20static struct option set_opts[] = { 20static struct option set_opts[] = {
21 { .name = "perf-bias", .has_arg = optional_argument, .flag = NULL, .val = 'b'}, 21 { .name = "perf-bias", .has_arg = required_argument, .flag = NULL, .val = 'b'},
22 { .name = "sched-mc", .has_arg = optional_argument, .flag = NULL, .val = 'm'}, 22 { .name = "sched-mc", .has_arg = required_argument, .flag = NULL, .val = 'm'},
23 { .name = "sched-smt", .has_arg = optional_argument, .flag = NULL, .val = 's'}, 23 { .name = "sched-smt", .has_arg = required_argument, .flag = NULL, .val = 's'},
24 { }, 24 { },
25}; 25};
26 26
diff --git a/tools/usb/Makefile b/tools/usb/Makefile
index 396d6c44e9d7..acf2165c04e6 100644
--- a/tools/usb/Makefile
+++ b/tools/usb/Makefile
@@ -3,11 +3,12 @@
3CC = $(CROSS_COMPILE)gcc 3CC = $(CROSS_COMPILE)gcc
4PTHREAD_LIBS = -lpthread 4PTHREAD_LIBS = -lpthread
5WARNINGS = -Wall -Wextra 5WARNINGS = -Wall -Wextra
6CFLAGS = $(WARNINGS) -g $(PTHREAD_LIBS) -I../include 6CFLAGS = $(WARNINGS) -g -I../include
7LDFLAGS = $(PTHREAD_LIBS)
7 8
8all: testusb ffs-test 9all: testusb ffs-test
9%: %.c 10%: %.c
10 $(CC) $(CFLAGS) -o $@ $^ 11 $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
11 12
12clean: 13clean:
13 $(RM) testusb ffs-test 14 $(RM) testusb ffs-test