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: * Tag thread comm as overriden, showing the right comm for threads after forks. (Frederic Weisbecker) * Fix memory leak when processing perf.data file header. (Namhyung Kim.) * Don't try to free string constant used for anonymous event groups. (Namhyung Kim) * Fix use of multiple options in processing field in libtraceevent. (Steven Rostedt) * Fix conversion of pointer to integer of different size in libtraceevent. (Arnaldo Carvalho de Melo) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
@@ -1606,6 +1606,24 @@ process_arg(struct event_format *event, struct print_arg *arg, char **tok)
|
|||||||
static enum event_type
|
static enum event_type
|
||||||
process_op(struct event_format *event, struct print_arg *arg, char **tok);
|
process_op(struct event_format *event, struct print_arg *arg, char **tok);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* For __print_symbolic() and __print_flags, we need to completely
|
||||||
|
* evaluate the first argument, which defines what to print next.
|
||||||
|
*/
|
||||||
|
static enum event_type
|
||||||
|
process_field_arg(struct event_format *event, struct print_arg *arg, char **tok)
|
||||||
|
{
|
||||||
|
enum event_type type;
|
||||||
|
|
||||||
|
type = process_arg(event, arg, tok);
|
||||||
|
|
||||||
|
while (type == EVENT_OP) {
|
||||||
|
type = process_op(event, arg, tok);
|
||||||
|
}
|
||||||
|
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
static enum event_type
|
static enum event_type
|
||||||
process_cond(struct event_format *event, struct print_arg *top, char **tok)
|
process_cond(struct event_format *event, struct print_arg *top, char **tok)
|
||||||
{
|
{
|
||||||
@@ -2371,7 +2389,7 @@ process_flags(struct event_format *event, struct print_arg *arg, char **tok)
|
|||||||
goto out_free;
|
goto out_free;
|
||||||
}
|
}
|
||||||
|
|
||||||
type = process_arg(event, field, &token);
|
type = process_field_arg(event, field, &token);
|
||||||
|
|
||||||
/* Handle operations in the first argument */
|
/* Handle operations in the first argument */
|
||||||
while (type == EVENT_OP)
|
while (type == EVENT_OP)
|
||||||
@@ -2424,7 +2442,8 @@ process_symbols(struct event_format *event, struct print_arg *arg, char **tok)
|
|||||||
goto out_free;
|
goto out_free;
|
||||||
}
|
}
|
||||||
|
|
||||||
type = process_arg(event, field, &token);
|
type = process_field_arg(event, field, &token);
|
||||||
|
|
||||||
if (test_type_token(type, token, EVENT_DELIM, ","))
|
if (test_type_token(type, token, EVENT_DELIM, ","))
|
||||||
goto out_free_field;
|
goto out_free_field;
|
||||||
|
|
||||||
@@ -3446,7 +3465,7 @@ eval_num_arg(void *data, int size, struct event_format *event, struct print_arg
|
|||||||
* is in the bottom half of the 32 bit field.
|
* is in the bottom half of the 32 bit field.
|
||||||
*/
|
*/
|
||||||
offset &= 0xffff;
|
offset &= 0xffff;
|
||||||
val = (unsigned long long)(data + offset);
|
val = (unsigned long long)((unsigned long)data + offset);
|
||||||
break;
|
break;
|
||||||
default: /* not sure what to do there */
|
default: /* not sure what to do there */
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -2078,8 +2078,10 @@ static int process_group_desc(struct perf_file_section *section __maybe_unused,
|
|||||||
if (evsel->idx == (int) desc[i].leader_idx) {
|
if (evsel->idx == (int) desc[i].leader_idx) {
|
||||||
evsel->leader = evsel;
|
evsel->leader = evsel;
|
||||||
/* {anon_group} is a dummy name */
|
/* {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;
|
evsel->group_name = desc[i].name;
|
||||||
|
desc[i].name = NULL;
|
||||||
|
}
|
||||||
evsel->nr_members = desc[i].nr_members;
|
evsel->nr_members = desc[i].nr_members;
|
||||||
|
|
||||||
if (i >= nr_groups || nr > 0) {
|
if (i >= nr_groups || nr > 0) {
|
||||||
@@ -2105,7 +2107,7 @@ static int process_group_desc(struct perf_file_section *section __maybe_unused,
|
|||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
out_free:
|
out_free:
|
||||||
while ((int) --i >= 0)
|
for (i = 0; i < nr_groups; i++)
|
||||||
free(desc[i].name);
|
free(desc[i].name);
|
||||||
free(desc);
|
free(desc);
|
||||||
|
|
||||||
|
@@ -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 */
|
/* Override latest entry if it had no specific time coverage */
|
||||||
if (!curr->start) {
|
if (!curr->start) {
|
||||||
comm__override(curr, str, timestamp);
|
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;
|
thread->comm_set = true;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user