From patchwork Fri Jun 19 14:34:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 223839 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B527C433E0 for ; Fri, 19 Jun 2020 16:12:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2E90E2168B for ; Fri, 19 Jun 2020 16:12:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592583166; bh=wums38tIbdlDkChcSKWLY242cq4emMf/+d/eJEQRV78=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=fesqNBD6WVEUl5LvPhqqMvdx3lJRIf1sUnv/acMjajO2AeWQfv3Eo0nZfjl0GDJ/C CjZlf59rBV8sjFuk5QWZlnm2jSjGpZfT/NVQoHUQsaF3QtqQvCq1vs3ebWKfSxjrTL PNRDoTz3Oo6nb1prP2eZfsXiXdRruUG5qqSPpMMw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390175AbgFSPEd (ORCPT ); Fri, 19 Jun 2020 11:04:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:33152 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391151AbgFSPE3 (ORCPT ); Fri, 19 Jun 2020 11:04:29 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1623F206DB; Fri, 19 Jun 2020 15:04:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592579068; bh=wums38tIbdlDkChcSKWLY242cq4emMf/+d/eJEQRV78=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=na9Apqz4PxHTDUHw2FWy7ICzl7jeb1R3Yygo1bb8+FmMuiVG4O1iIDYiT1FO+Sc81 ADtibyQLGdEpBYAjcHOuO41VhTjBt6eI8AzB4swrvaE3hORiU5agb/To/nkHrQsZIJ AKRMwiTY4Xm1JMcBpKD5PVOzE56iRkP3PxVWejek= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masami Hiramatsu , Arnaldo Carvalho de Melo , Jiri Olsa , Namhyung Kim Subject: [PATCH 4.19 264/267] perf probe: Do not show the skipped events Date: Fri, 19 Jun 2020 16:34:09 +0200 Message-Id: <20200619141701.342034355@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619141648.840376470@linuxfoundation.org> References: <20200619141648.840376470@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Masami Hiramatsu commit f41ebe9defacddeae96a872a33f0f22ced0bfcef upstream. When a probe point is expanded to several places (like inlined) and if some of them are skipped because of blacklisted or __init function, those trace_events has no event name. It must be skipped while showing results. Without this fix, you can see "(null):(null)" on the list, # ./perf probe request_resource reserve_setup is out of .text, skip it. Added new events: (null):(null) (on request_resource) probe:request_resource (on request_resource) You can now use it in all perf tools, such as: perf record -e probe:request_resource -aR sleep 1 # With this fix, it is ignored: # ./perf probe request_resource reserve_setup is out of .text, skip it. Added new events: probe:request_resource (on request_resource) You can now use it in all perf tools, such as: perf record -e probe:request_resource -aR sleep 1 # Fixes: 5a51fcd1f30c ("perf probe: Skip kernel symbols which is out of .text") Signed-off-by: Masami Hiramatsu Tested-by: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Namhyung Kim Cc: stable@vger.kernel.org Link: http://lore.kernel.org/lkml/158763968263.30755.12800484151476026340.stgit@devnote2 Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Greg Kroah-Hartman --- tools/perf/builtin-probe.c | 3 +++ 1 file changed, 3 insertions(+) --- a/tools/perf/builtin-probe.c +++ b/tools/perf/builtin-probe.c @@ -376,6 +376,9 @@ static int perf_add_probe_events(struct for (k = 0; k < pev->ntevs; k++) { struct probe_trace_event *tev = &pev->tevs[k]; + /* Skipped events have no event name */ + if (!tev->event) + continue; /* We use tev's name for showing new events */ show_perf_probe_event(tev->group, tev->event, pev,