perf/urgent fixes:

. Tag thread comm as overriden, showing the right comm for threads after forks,
   fix from Frederic Weisbecker.
 
 . Fix memory leak when processing perf.data file header, from Namhyung Kim.
 
 . Don't try to free string constant used for anonymous event groups, fix from Namhyung Kim.
 
 . Fix use of multiple options in processing field in libtraceevent, fix from Steven Rostedt.
 
 . Fix conversion of pointer to integer of different size in libtraceevent.
 
 Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.14 (GNU/Linux)
 
 iQIcBAABAgAGBQJSi8vjAAoJENZQFvNTUqpA8KQQAJ7dmnhPWx0TW9+vQl47xnpj
 2ZZG57cDkMyTd6HTQgj02QtYCAfH02aZQ/N6a1/45I6GOwcbp7Q4EBaj3T4eZquE
 uvEGvl2QJ6sonApgCv1Qx0mZA7tRhe4crMugpp0qowS2JYBIH6M0uITeEUtTwFwA
 j52kJyMxIrjpvkjhgecK5h8kRvVXaaupaOv2IHN5vPn6gTgrsUQ+peOh2LcHYDP+
 spocEKkycVuMuQfUZHaMeH78zG6Kuxp+AM7A7qqbP5ivmybRCm5tQL0+WuYJakm6
 MniFUlIsdeQCksWreUQJAxfKQWrwApBYtPnn4eKbad6/Vre/+olmmyRCyrxQUY1t
 HLVPp139Yb/GPSfacYX4YCj0V5XUP2mNCID4kKRpq+T7pF1/acENqMniTeI9OREf
 E+LzzCUYdQnl1uZi45AduYPfHhr8hjwcX0R1OVHaxyDOusKRJBAgYqpT82UizTwp
 ggpa/jMfxrznIpEv354RBjSZ4D+IYzdO+rt92ljnbazoq7jQvqj5kK9aRc4S79Sq
 7aon33i6LTk69OJ2Vas918u/mCpFwYTAErUWWLjamo2upHYSoOX5zL36sI24pmlv
 OEU7YDadU1LAqe21QRlfoUA6omMkt3/dcdIHRuTbNW9fESUsH6RwKajpcls3HxOZ
 moVKx9R5tATp3uWTdZ/K
 =uwWi
 -----END PGP SIGNATURE-----

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:
Ingo Molnar 2013-11-20 14:29:46 +01:00
commit e98a6e59df
3 changed files with 31 additions and 11 deletions

View File

@ -1606,6 +1606,24 @@ process_arg(struct event_format *event, struct print_arg *arg, char **tok)
static enum event_type
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
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;
}
type = process_arg(event, field, &token);
type = process_field_arg(event, field, &token);
/* Handle operations in the first argument */
while (type == EVENT_OP)
@ -2424,7 +2442,8 @@ process_symbols(struct event_format *event, struct print_arg *arg, char **tok)
goto out_free;
}
type = process_arg(event, field, &token);
type = process_field_arg(event, field, &token);
if (test_type_token(type, token, EVENT_DELIM, ","))
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.
*/
offset &= 0xffff;
val = (unsigned long long)(data + offset);
val = (unsigned long long)((unsigned long)data + offset);
break;
default: /* not sure what to do there */
return 0;

View File

@ -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);

View File

@ -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;