lkml.org 
[lkml]   [2015]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH perf/core 5/8] perf probe: Allow to use filter on --del command
On Tue, Apr 21, 2015 at 08:42:06PM +0900, Masami Hiramatsu wrote:
> -int del_perf_probe_events(struct strlist *dellist)
> +int del_perf_probe_events(struct strfilter *filter)
> {
> - int ret = -1, ret2, ufd = -1, kfd = -1;
> - char buf[128];
> - const char *group, *event;
> - char *p, *str;
> - struct str_node *ent;
> + int ret = 0, ufd = -1, kfd = -1;
> struct strlist *namelist = NULL, *unamelist = NULL;
> + char *str = strfilter__string(filter);

You may want to check the return value here - or in the
strfilter__string() ?

Thanks,
Namhyung


> +
> + pr_debug("Filter: \'%s\'\n", str);

[SNIP]
> +char *strfilter__string(struct strfilter *filter)
> +{
> + int len;
> + char *ret = NULL;
> +
> + len = strfilter_node__sprint(filter->root, NULL);
> + if (len < 0)
> + return NULL;
> +
> + ret = malloc(len + 1);

Here?

> + strfilter_node__sprint(filter->root, ret);
> +
> + return ret;
> +}


\
 
 \ /
  Last update: 2015-04-22 16:21    [W:0.096 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site