Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933122AbbDVN6J (ORCPT ); Wed, 22 Apr 2015 09:58:09 -0400 Received: from mail-pd0-f170.google.com ([209.85.192.170]:32894 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932850AbbDVN6G (ORCPT ); Wed, 22 Apr 2015 09:58:06 -0400 Date: Wed, 22 Apr 2015 22:56:57 +0900 From: Namhyung Kim To: Masami Hiramatsu Cc: Arnaldo Carvalho de Melo , Peter Zijlstra , Linux Kernel Mailing List , David Ahern , Jiri Olsa , Ingo Molnar Subject: Re: [PATCH perf/core 5/8] perf probe: Allow to use filter on --del command Message-ID: <20150422135657.GC1622@danjae.kornet> References: <20150421114155.21617.91519.stgit@localhost.localdomain> <20150421114206.21617.9099.stgit@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20150421114206.21617.9099.stgit@localhost.localdomain> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1147 Lines: 46 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; > +} -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/