Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp790457rdb; Tue, 19 Sep 2023 10:10:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHswivCMWZX9OQ/UHxu69FHjNf2upb1IeUMjfCo7SW0RSFCi124ZBUmV3s3AQdlsJcyMi4l X-Received: by 2002:a05:6a20:9383:b0:149:97e4:8ae4 with SMTP id x3-20020a056a20938300b0014997e48ae4mr425953pzh.0.1695143403969; Tue, 19 Sep 2023 10:10:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695143403; cv=none; d=google.com; s=arc-20160816; b=zqwM0857mwG7patrQRKu7unzsNZKZpjNaaBtvBN4+OPhXUmn/G2q6tgC7DQJwfGHsk RygIV9QbVZ7yfwyxOQ6DWBk4DxtrZdyI795+6/YpBrcaa+RuTwL8rnbSnq9ds8g7+CNs S8YDvMLKNDn05YjsCW+OtfFYaivMel7a3hFqf+NU1wmdHPUrCEHFyq4D4/tRcZNn1lxG NQBCSuKnlF0djxNrpqbqhyLmU9Y5uyPm97xbJZNq4G8aM/SWiRzyeNyaqVhJ0Pk0rp0p QNxWd288V83MP0YAf+NBR0XU2A4gI6JGK2tXWpzvPvQmidVyAyOpeBFpJ0PeUL0bbCyu 2o1A== 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:cc:to:subject:user-agent:mime-version:date:message-id; bh=Y9KlukAMsIxGhjE1NYAzpTbOIarPvY4yXfVhh4HU8ag=; fh=8oOzDjMdhUv+jylS58T8G56hgACd5EC3lB6nL7ULA2U=; b=veo1c0lSy8pNkEXRxDU3/mvXkhtwnSy+RiKLWNoBhy3iyGOlYLuhUbPh80pXAjq4Te 3My1FLqoxvHwxlwcLMoK4KrWEGGBhoo3iZzbAw69LByx2nAm+aCLaHKb+WX6H/6JG05x AwCbBc/6X5yMQP1Fb/D9e2Y1nSQuXowwxf+prKK/JQccmov7rARxeoBuuh7ZBC2YDOxL VhLfF2gMiZS3PQC7DqLjzjTIIMEFDmaAGoKNypg1Nab57vuHFSM8xhkstIODNocSuvtJ soLAfs4tMJG25bfS7PG+iDtE+VAvlS1tccp5HOueBF7YWoPmSyX172ui77FFta7+DUVh E/xw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id j2-20020a63e742000000b00577549e67b9si1624078pgk.589.2023.09.19.10.10.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 10:10:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id EFCA8826E8B5; Tue, 19 Sep 2023 10:01:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230203AbjISRBs (ORCPT + 99 others); Tue, 19 Sep 2023 13:01:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229772AbjISRBr (ORCPT ); Tue, 19 Sep 2023 13:01:47 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AC102AD; Tue, 19 Sep 2023 10:01:41 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 590051FB; Tue, 19 Sep 2023 10:02:18 -0700 (PDT) Received: from [10.57.94.61] (unknown [10.57.94.61]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8187A3F5A1; Tue, 19 Sep 2023 10:01:39 -0700 (PDT) Message-ID: <3cc013bd-c85e-b28a-f921-d5593b3935a4@arm.com> Date: Tue, 19 Sep 2023 18:01:38 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v2 5/5] hwtracing: hisi_ptt: Add dummy callback pmu::read() To: Yicong Yang , mathieu.poirier@linaro.org, jonathan.cameron@huawei.com, linux-kernel@vger.kernel.org Cc: yangyicong@hisilicon.com, alexander.shishkin@linux.intel.com, helgaas@kernel.org, linux-pci@vger.kernel.org, prime.zeng@hisilicon.com, linuxarm@huawei.com, hejunhao3@huawei.com References: <20230914112223.27165-1-yangyicong@huawei.com> <20230914112223.27165-6-yangyicong@huawei.com> <73655f9b-9ea4-cb46-d712-20f1c4ac7c95@arm.com> <75b93d15-f099-5d17-caa9-94b0390773cf@huawei.com> From: Suzuki K Poulose In-Reply-To: <75b93d15-f099-5d17-caa9-94b0390773cf@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 19 Sep 2023 10:01:59 -0700 (PDT) On 19/09/2023 14:03, Yicong Yang wrote: > On 2023/9/15 20:53, Suzuki K Poulose wrote: >> On 14/09/2023 12:22, Yicong Yang wrote: >>> From: Junhao He >>> >>> When start trace with perf option "-C $cpu" and immediately stop it >>> with SIGTERM or others, the perf core will invoke pmu::read() while >>> the driver doesn't implement it. Add a dummy pmu::read() to avoid >>> any issues. >> >> What issues are we talking about here ? Shouldn't the core perf >> skip the call, if pmu::read() is not available ? >> > > Actually no, the core doesn't check it. So I think that's why some PMUs > like SPE implements a dummy pmu::read() callback. Otherwise we'll > dereference a NULL pointer. > > Currently we only met this on emulated platforms with very slow CPUs, > follow the instructions in the commit above. Ok, then it calls for a Fixes tag. Please tag it to the commit that introduced the PMU. Suzuki