lkml.org 
[lkml]   [2017]   [Mar]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2] Allow user probes on versioned symbols
From
Date
On 3/30/17 11:00 AM, Paul Clarke wrote:
> diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
> index 4f9a71c..90342ee 100644
> --- a/tools/perf/util/map.c
> +++ b/tools/perf/util/map.c
> @@ -330,6 +330,27 @@ int __weak arch__compare_symbol_names(const char
> *namea, const char *nameb)
> return strcmp(namea, nameb);
> }
>
> +int map__compare_symbol_names(const char *namea, const char *nameb)
> +{
> + int rc;
> + const char *namea_versioning, *nameb_versioning;
> +
> + namea_versioning = strstr(namea,"@@");
> + if (namea_versioning)
> + namea = strndup(namea,namea_versioning-namea);
> +
> + nameb_versioning = strstr(nameb,"@@");
> + if (nameb_versioning)
> + nameb = strndup(nameb,nameb_versioning-nameb);
> +
> + rc = arch__compare_symbol_names(namea, nameb);
> +
> + if (namea_versioning) free((void *)namea);
> + if (nameb_versioning) free((void *)nameb);

free() should be on the next line. Otherwise LGTM

Reviewed-by: David Ahern <dsahern@gmail.com>

\
 
 \ /
  Last update: 2017-03-31 16:20    [W:0.055 / U:1.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site