Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1100769rwr; Thu, 27 Apr 2023 12:19:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5szKaThuM/rZ5g+Gvb4xKv1IxLzTE4RVJrVTg5TQxWePZaRHMg9pQgXyYylC5NvvYCJFj0 X-Received: by 2002:a05:6a20:244d:b0:f6:28de:89e8 with SMTP id t13-20020a056a20244d00b000f628de89e8mr3913809pzc.0.1682623145253; Thu, 27 Apr 2023 12:19:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682623145; cv=none; d=google.com; s=arc-20160816; b=PgZ/D8ZTdKR3U4C0mLEvohGrW1TC8GlK/n8Sw1Y3WKNe8ggoGYbH7PT9+zMKjaCgLo eHImt70wwrighrpjMQA75+y9x3K8NDWq57U9toocbjWndmf3asA18ywJ1akUHivNuSKr 7NLxHK+EUejsFa6jE0/FXuq56B2S6gBwx8IcO5XBg5uTBuldMMMHrUhspAmn6xQdo/sv c07z+SLz2JeYiVfHu5aZ8oFMg7rBWEU8fc1Gx+PbGtFilm0lbJoLdR2TLdWl/T+TAqMZ /z0jjNQZ3nq2L+Xmt7r6TZw0JhDH/vU/GaiUht+wsfobLZobJefcimcag2Rt6TcDu067 x+EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=TH7m0799KB9+1ruAFQ77buI9hM+DOHrpWXGYHF+nXkw=; b=hD1H/BSRhpUuJx/FMjLiQhyNlmG69y6D+GMDfwQegmK/uoM1SErC5TciqWBj1vC25T yumLAJEsVp+Hbo31NaAIiyh6x0/tDUAOavM91yLePbPZ3NfuCSOqpoGt0Lm0IPtkDyoL lABMgkqmt+5JA2Ab0xjEYeAR/0Ci/pIlYkqCfxcjLwdkriIcbgMS+VFw43MEls9bg0QS qoUPH5rg3oJJmK/fCDOpF4aQK389kUcvsuGHQo0DjbDJ1kP0Yw4q97p1gFqF1HEcQiyU w8ovX1Pvun7dSxpGIwCIZkEsA4x2RiZ98BukL9AIl0lNY2LFBJfKk8yyzEC7YKuxoBSl kUVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jYC5V37d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b15-20020a63eb4f000000b0051f74820afdsi19435709pgk.782.2023.04.27.12.18.52; Thu, 27 Apr 2023 12:19:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jYC5V37d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244526AbjD0TMS (ORCPT + 99 others); Thu, 27 Apr 2023 15:12:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229539AbjD0TMQ (ORCPT ); Thu, 27 Apr 2023 15:12:16 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5F06114; Thu, 27 Apr 2023 12:12:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1682622735; x=1714158735; h=message-id:date:mime-version:subject:to:references:from: in-reply-to:content-transfer-encoding; bh=pnW5qMLh79Dl32TPLXe6aP7KhsJKvNpI6UV1iCK3VYQ=; b=jYC5V37d9Bw8T6jrIKoknlDS/HtdKzUvaeL8PPtXqn9uIm4LjeeNmdi8 pIdbhIND6GYnGC+TYlkmGqtNYapyjVRG9IhJ0wR6oE/eSs44j8yGPwfk5 +oJTf7JE7nZJ27PnqksTxe/l6fHMWknhzudOl14Fpep9KfKDbBbDb9Zos 0qp+5+ipKbY5Wv3hNTTPYO7L7oT/99TvjzqDZFsGJxg7SnsNvK8NrxpHW +syZyJa1SwGs2UgrD+yqdJI1ocv08PyvH5/uwt3GRwDdhSH6Zbyx6fWzu 8lUf+B923ZXRsco/pwQkYVRE/XqXULl448PDQ+cIGPc2xLBJtOduVq9iF Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10693"; a="336540560" X-IronPort-AV: E=Sophos;i="5.99,232,1677571200"; d="scan'208";a="336540560" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2023 12:11:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10693"; a="688540380" X-IronPort-AV: E=Sophos;i="5.99,232,1677571200"; d="scan'208";a="688540380" Received: from linux.intel.com ([10.54.29.200]) by orsmga007.jf.intel.com with ESMTP; 27 Apr 2023 12:11:54 -0700 Received: from [10.209.41.222] (kliang2-mobl1.ccr.corp.intel.com [10.209.41.222]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by linux.intel.com (Postfix) with ESMTPS id 74010580377; Thu, 27 Apr 2023 12:11:50 -0700 (PDT) Message-ID: <15ca8bed-db47-182e-1ae3-33e273027776@linux.intel.com> Date: Thu, 27 Apr 2023 15:11:49 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v1 07/40] perf stat: Avoid segv on counter->name Content-Language: en-US To: Ian Rogers , Arnaldo Carvalho de Melo , Ahmad Yasin , Peter Zijlstra , Ingo Molnar , Stephane Eranian , Andi Kleen , Perry Taylor , Samantha Alt , Caleb Biggers , Weilin Wang , Edward Baker , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , Florian Fischer , Rob Herring , Zhengjun Xing , John Garry , Kajol Jain , Sumanth Korikkar , Thomas Richter , Tiezhu Yang , Ravi Bangoria , Leo Yan , Yang Jihong , James Clark , Suzuki Poulouse , Kang Minchul , Athira Rajeev , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230426070050.1315519-1-irogers@google.com> <20230426070050.1315519-8-irogers@google.com> From: "Liang, Kan" In-Reply-To: <20230426070050.1315519-8-irogers@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023-04-26 3:00 a.m., Ian Rogers wrote: > Switch to use evsel__name that doesn't return NULL for hardware and > similar events. This one should be backport to 6.4. It helps to fix the Segmentation fault with default mode. https://lore.kernel.org/lkml/2b8768bf-de24-946f-62da-6ed171a5c324@linux.intel.com/ > Signed-off-by: Ian Rogers Reviewed-by: Kan Liang Thanks, Kan > --- > tools/perf/util/stat-display.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c > index 6b46bbb3d322..71dd6cb83918 100644 > --- a/tools/perf/util/stat-display.c > +++ b/tools/perf/util/stat-display.c > @@ -747,7 +747,7 @@ static void uniquify_event_name(struct evsel *counter) > int ret = 0; > > if (counter->uniquified_name || counter->use_config_name || > - !counter->pmu_name || !strncmp(counter->name, counter->pmu_name, > + !counter->pmu_name || !strncmp(evsel__name(counter), counter->pmu_name, > strlen(counter->pmu_name))) > return; >