From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754570AbbDTJWU (ORCPT ); Mon, 20 Apr 2015 05:22:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54263 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754319AbbDTJWT (ORCPT ); Mon, 20 Apr 2015 05:22:19 -0400 Date: Mon, 20 Apr 2015 11:21:59 +0200 From: Jiri Olsa To: Namhyung Kim 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: <20150420092159.GC9872@krava.redhat.com> References: <1429416255-12070-1-git-send-email-namhyung@kernel.org> <1429416255-12070-7-git-send-email-namhyung@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1429416255-12070-7-git-send-email-namhyung@kernel.org> 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 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 > + 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