Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp104496rwb; Tue, 6 Dec 2022 18:01:13 -0800 (PST) X-Google-Smtp-Source: AA0mqf5zS2PgJBPQkJmcYV07wLNnAUXHexfblLaRq9NwcL7uzKDZOE7tjT7uVogIoIHWbkNtdtq1 X-Received: by 2002:a63:c143:0:b0:45b:f8be:7400 with SMTP id p3-20020a63c143000000b0045bf8be7400mr64646138pgi.30.1670378472753; Tue, 06 Dec 2022 18:01:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670378472; cv=none; d=google.com; s=arc-20160816; b=VE0iw22HhvWhrZq7F3unpeqso68K0duzNSaU6hqWeG9eEsuAkr3yuaocp62XikyWbv vrUNUJWZoLeLrwUhUJr+KK63pg08a4wzXWntCpIme1HdPhvj56BMWcVq4IJeTP3GonkJ Pzsoj6WycmgekOmNfGHYI5sWpzT+MVueaLGSB16XmtEJeLeLUauEzlcvYG+U3yFR0FPx k29ILipqIK8VfbRTMZgahsBH0YCInVFrxQ2zLaRNRLPin4d5V+44pyFSPggJUHlzrKH/ HcqmOR2LKrb1JFYMh9LxP1NCF7Qz4opvbvZhNFVdWHZfvGQwqiYQZCBGYlN5VrsJBPNw NnJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject; bh=+a5P6Bk7FkRMzpj1dtaexkTe8XDOUsjvxmt/QkKhQhA=; b=s3xS0YzEkSOZ89wYUaBJMCdBlEAmFpSND0zWfFLw3h8FwlAhOKlvQScVxc6ThqYiMo 1swlKgPq0whQ8XcYsUYpTlrac2Dxe2cN/MRW0qYuQk5h8SKfCa2pg2bCThm3HeHHH8WT a+1iPeAXGgINhSwa6aLnnhlDNBFDM4J+ep7z9AzvawnYzTo8EG1TCjHt5Kem8H0IizOX KRM3A+9q/wa29fymip7kdoM/znas0dHxAMpdu/Z9vv4jnjBHzLqyU3dW61GUIYeGdDWc HHvl/RBqTdgQuooOi+CfirzaOGrflfJPLVlSPt1wSIbts+Isp/TzzfRkuxkc04i9uYkT PayQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j10-20020a63cf0a000000b0046f3dfb97a5si18983248pgg.660.2022.12.06.18.00.54; Tue, 06 Dec 2022 18:01:12 -0800 (PST) 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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229816AbiLGBfD (ORCPT + 78 others); Tue, 6 Dec 2022 20:35:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229576AbiLGBfA (ORCPT ); Tue, 6 Dec 2022 20:35:00 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 405D14B9A1; Tue, 6 Dec 2022 17:35:00 -0800 (PST) Received: from kwepemm600003.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4NRfqr6ML3zqSwx; Wed, 7 Dec 2022 09:30:48 +0800 (CST) Received: from [10.67.111.205] (10.67.111.205) by kwepemm600003.china.huawei.com (7.193.23.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 7 Dec 2022 09:34:58 +0800 Subject: Re: [PATCH] blktrace: Fix output non-blktrace event when blk_classic option enabled To: , , , , , , References: <20221122040410.85113-1-yangjihong1@huawei.com> From: Yang Jihong Message-ID: Date: Wed, 7 Dec 2022 09:34:57 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <20221122040410.85113-1-yangjihong1@huawei.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.111.205] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600003.china.huawei.com (7.193.23.202) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS 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 Hello, PING. Thanks, Yang. On 2022/11/22 12:04, Yang Jihong wrote: > When the blk_classic option is enabled, non-blktrace events must be > filtered out. Otherwise, events of other types are output in the blktrace > classic format, which is unexpected. > > The problem can be triggered in the following ways: > > # echo 1 > /sys/kernel/debug/tracing/options/blk_classic > # echo 1 > /sys/kernel/debug/tracing/events/enable > # echo blk > /sys/kernel/debug/tracing/current_tracer > # cat /sys/kernel/debug/tracing/trace_pipe > > Fixes: c71a89615411 ("blktrace: add ftrace plugin") > Signed-off-by: Yang Jihong > --- > kernel/trace/blktrace.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c > index a995ea1ef849..a66cff5a1857 100644 > --- a/kernel/trace/blktrace.c > +++ b/kernel/trace/blktrace.c > @@ -1548,7 +1548,8 @@ blk_trace_event_print_binary(struct trace_iterator *iter, int flags, > > static enum print_line_t blk_tracer_print_line(struct trace_iterator *iter) > { > - if (!(blk_tracer_flags.val & TRACE_BLK_OPT_CLASSIC)) > + if ((iter->ent->type != TRACE_BLK) || > + !(blk_tracer_flags.val & TRACE_BLK_OPT_CLASSIC)) > return TRACE_TYPE_UNHANDLED; > > return print_one_line(iter, true); >