Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934622AbbDWNLI (ORCPT ); Thu, 23 Apr 2015 09:11:08 -0400 Received: from mail9.hitachi.co.jp ([133.145.228.44]:52229 "EHLO mail9.hitachi.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934581AbbDWNLF (ORCPT ); Thu, 23 Apr 2015 09:11:05 -0400 Message-ID: <5538EF62.6060005@hitachi.com> Date: Thu, 23 Apr 2015 22:10:58 +0900 From: Masami Hiramatsu Organization: Hitachi, Ltd., Japan User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 MIME-Version: 1.0 To: Namhyung Kim CC: Arnaldo Carvalho de Melo , Peter Zijlstra , Linux Kernel Mailing List , David Ahern , Jiri Olsa , Ingo Molnar Subject: Re: Re: [PATCH perf/core 5/8] perf probe: Allow to use filter on --del command References: <20150421114155.21617.91519.stgit@localhost.localdomain> <20150421114206.21617.9099.stgit@localhost.localdomain> <20150422135657.GC1622@danjae.kornet> In-Reply-To: <20150422135657.GC1622@danjae.kornet> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1999 Lines: 76 (2015/04/22 22:56), Namhyung Kim wrote: > 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() ? Ah, right. Even though this str is only for debugging, it is better to verify the filter is correctly built by strfilter__string. I'll check the return value here. > > 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? Oops, of course there need another check :) this is just a simple care-less miss. Thanks again! > >> + 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/ > -- Masami HIRAMATSU Linux Technology Research Center, System Productivity Research Dept. Center for Technology Innovation - Systems Engineering Hitachi, Ltd., Research & Development Group E-mail: masami.hiramatsu.pt@hitachi.com -- 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/