From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754958AbbDTMWq (ORCPT ); Mon, 20 Apr 2015 08:22:46 -0400 Received: from mail-pd0-f176.google.com ([209.85.192.176]:34690 "EHLO mail-pd0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754610AbbDTMWo (ORCPT ); Mon, 20 Apr 2015 08:22:44 -0400 Date: Mon, 20 Apr 2015 21:21:37 +0900 From: Namhyung Kim To: Jiri Olsa Cc: Arnaldo Carvalho de Melo , Ingo Molnar , Peter Zijlstra , LKML , David Ahern Subject: Re: [PATCH 6/7] perf hists browser: Split popup menu actions Message-ID: <20150420122137.GD8483@danjae.kornet> References: <1429416255-12070-1-git-send-email-namhyung@kernel.org> <1429416255-12070-7-git-send-email-namhyung@kernel.org> <20150420092159.GC9872@krava.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20150420092159.GC9872@krava.redhat.com> 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 On Mon, Apr 20, 2015 at 11:21:59AM +0200, Jiri Olsa wrote: > On Sun, Apr 19, 2015 at 01:04:14PM +0900, Namhyung Kim wrote: > > SNIP > > > + > > +static int > > +add_script_opt(struct popup_option *opt, char **optstr, > > + struct hist_browser *browser __maybe_unused, > > + struct thread *thread, struct symbol *sym) > > +{ > > + if (thread) { > > + if (asprintf(optstr, "Run scripts for samples of thread [%s]", > > + thread__comm_str(thread)) < 0) > > + return 0; > > + } else if (sym) { > > there's also check for sym->namelen in the original code Ah, right. I'll change it. But I wonder there's a case 'sym && !sym->namelen' though.. Thanks, Namhyung > > > + if (asprintf(optstr, "Run scripts for samples of symbol [%s]", > > + sym->name) < 0) > > + return 0; > > + } else { > > + if (asprintf(optstr, "Run scripts for all samples") < 0) > > + return 0; > > + } > > + > > + opt->thread = thread; > > + opt->sym = sym; > > + opt->fn = do_run_script; > > + > > + return 1; > > +} > > SNIP