Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp447007pxk; Wed, 23 Sep 2020 07:17:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdMk7s52Yd47TSQXoajRHVNNCO/lJR8Sg1/XlI8feSsWEi7WjDsHlo9S4QDNoJVQPwXaM6 X-Received: by 2002:a50:a693:: with SMTP id e19mr9734167edc.205.1600870628806; Wed, 23 Sep 2020 07:17:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600870628; cv=none; d=google.com; s=arc-20160816; b=Xw+sSv2yKZLeU9ZiS/MUkgVoUqdp9J7xeWfoqnTs1LRDYltifF5b6p3x6HbItx+3Rv siMEUVlkR2SBfYo2kco7Ojia8BlXFEXtLZcehW+zYQq3i0CrarRktrTZXIAX0XSh6SnX sJHae7yU2RTZRACmK/8ZKcIlH21z+xlhRWFDGv8c3qWBNrmvC4HI0GSDCFSNcgcHV7aT wrhcVIV5zKtyEq3VEGOpfrX1zZ9BbV9AfGv8jmEZ0tPjDlKu5E8/r4njFYz6knjKncP4 nM5Z+724kA7vulEngDWEyIEg0omtEH6t92MVWy5KFdDB4VoP4iMaclo5Q9CuiRFZCZEh lbfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=g1cxuReaAgVqr4A+WOonKaUioyziBa2g1hewHvpcxLk=; b=WdYMnjxMN8oJolgJsDWPXSQ7OZZYxm2azhntzTzj/PKcDBYt4FLXayDAG8LsNtpU0H TDp2PjNdtehsbfybhcG1hu9WVgEn9D2V5B39iT6yWjiw1cQP62zeJ3uVOuCfNKkyB7WV J0066AX0TG46cj0Evhf5RBUNw1bIvO+Vwf7+8eTACR2L4gW0A0geO7yd8cQMZW1fx4a/ /WVzF9BdYcMTpCHkYJJvqUx+G9SoBx/JxVOIqtvngt9qcgxMZohpz/einAqOGPmpTVpM AKOnrjU3zRjlcTgtO+z6wcBbD7FEUnhKCfMM0k8MXrKYBpqNV40PAgyvWQDeV6dWii73 9y4w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j33si13650237edc.537.2020.09.23.07.16.40; Wed, 23 Sep 2020 07:17:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726641AbgIWOPY (ORCPT + 99 others); Wed, 23 Sep 2020 10:15:24 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:51021 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726130AbgIWOPU (ORCPT ); Wed, 23 Sep 2020 10:15:20 -0400 Received: by mail-wm1-f67.google.com with SMTP id e17so208268wme.0 for ; Wed, 23 Sep 2020 07:15:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=g1cxuReaAgVqr4A+WOonKaUioyziBa2g1hewHvpcxLk=; b=SHWj34h9g3CF9CdR79WkjfeDQ4Iwx/QAOQa2VbK4w5wpawNM3Re3UCxTNM8y3EYTH/ JknkUkEJ96arpDvLN9wvvjsS2PbQsy9iLiaR3j5sGHRB73/9/vu/BP3pfJ5Nsq7L3cIC nUPZeoKvAECGS67JekVsxo/uvmwVSvhy1p4GE9YZbBv+2y9aYO/VJ6YxgZXUlafTkVQl fn8UvNF5csp9xlmS06mZU0tYrVQpB1zEALgokR88lC3plbvRW1AThLtmgmtmUZnOG6S1 gC0/uSgjWwrT5uD2tiNOdEXb+HCsEkst1akjZXHSpNBwvsoK+P24qGWJA9pVsY3A0VKP mpdQ== X-Gm-Message-State: AOAM530ZutMPMC+rbRsXJ2FtIIgLkh1d48hjq7HFAu5dVW3HFOFr1d5z Trdt6Qh4DcOfXd9tFnaiZK/Sk39Twu6JejKFIvA= X-Received: by 2002:a1c:6341:: with SMTP id x62mr6776560wmb.70.1600870517981; Wed, 23 Sep 2020 07:15:17 -0700 (PDT) MIME-Version: 1.0 References: <20200922031346.15051-1-liwei391@huawei.com> <20200922031346.15051-2-liwei391@huawei.com> <20200923054426.GG2893484@krava> <20200923140747.GN2893484@krava> In-Reply-To: <20200923140747.GN2893484@krava> From: Namhyung Kim Date: Wed, 23 Sep 2020 23:15:06 +0900 Message-ID: Subject: Re: [PATCH 1/2] perf stat: Fix segfault when counting armv8_pmu events To: Jiri Olsa Cc: Wei Li , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Andi Kleen , Alexey Budankov , Adrian Hunter , Peter Zijlstra , Ingo Molnar , linux-kernel , linux-arm-kernel@lists.infradead.org, Li Bin Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 23, 2020 at 11:08 PM Jiri Olsa wrote: > > On Wed, Sep 23, 2020 at 10:49:52PM +0900, Namhyung Kim wrote: > > On Wed, Sep 23, 2020 at 2:44 PM Jiri Olsa wrote: > > > > > > On Tue, Sep 22, 2020 at 11:13:45AM +0800, Wei Li wrote: > > > > When executing perf stat with armv8_pmu events with a workload, it will > > > > report a segfault as result. > > > > > > please share the perf stat command line you see that segfault for > > > > It seems the description in the patch 0/2 already has it: > > > > [root@localhost hulk]# tools/perf/perf stat -e > > armv8_pmuv3_0/ll_cache_rd/,armv8_pmuv3_0/ll_cache_miss_rd/ ls > > > /dev/null > > Segmentation fault > > yea I found it, but can't reproduce it.. I see the issue from > patch 2, but not sure what's the problem so far I think the problem is that armv8_pmu has a cpumask, and the user requested per-task events. The code tried to open the event with a dummy cpu map since it's not a cpu event, but the pmu has cpu map and it's passed to evsel. So there's confusion somewhere whether it should use evsel->cpus or a dummy map. Thanks Namhyung