From patchwork Tue Jan 31 16:30:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Bristot de Oliveira X-Patchwork-Id: 50967 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1748wrn; Tue, 31 Jan 2023 08:32:00 -0800 (PST) X-Google-Smtp-Source: AK7set+9Mx53kB49lblGAOZEE+cQ3NU2Pz+6K0npZTztm9YffS1v5XMTHmDEERaiYK0VW/VFzznB X-Received: by 2002:a05:6a20:3ca2:b0:bc:ee95:dee with SMTP id b34-20020a056a203ca200b000bcee950deemr11220391pzj.37.1675182719647; Tue, 31 Jan 2023 08:31:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675182719; cv=none; d=google.com; s=arc-20160816; b=VNSm6/+zYK0+/Vi+upiaPjZ5d8nwvkv6VVqPB9IhP1YtUE4800gCKwCiLLUgwCJsGW 66rLGEs1MKHkocCQ07mT+7ZY7vNKgfweHnX87rRef4/DyBXtW8GzexfWFx0cMMwUv35D sMuki6IM6qRzhfSP94nk3nHU4Fkb707ogVt3u6VPSyt4V5/Uu8RrXDhNL8PFZFQf0mFQ 3MGhlPrRSfRpa+DxkaI8EiMW/hdtc9PpEiDOxwmyuFHbvr5DrRza3oC3UxKdMCnKp1R5 1IdffotI1Mc5zljCoHpnFpnVRQe/j+oYt8hGjVNwHSZLxqujmqozYGt1NaATetjBkxiD E0ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=VyW3+sdMY10GjiInVu001v0C8K+w289Agw1hyV9AY2c=; b=tmkhcun5Bc+r2CnHOIIikh/VFZtK3QBmgdAC5zABY/9rIcSI44PiJAeW5ARTokEwsK 6v8RkbjwftVXXADvIYNlRQoVyewTcDDtez2KPKYSMFHT1ZEYHijbxoeQ0y1CeRKC+Ehb ctnm07hS37TQLBysbU05lnZkgYSpl2Bzhu1WlxFPbqmT2n27rEoZhYUyVtfa2PK1dv0x +AKfg3c+ycO57t0o17RB4FKt8UPCDS6Gc3FgLQHOoYx3B7AfqCKAfknp+8X8hmneaFlC UYvbKZxKEb/+3vOzfKzJ5qE5opV9okNl1MmioEyq4NwWzVLGuIR85He/JDDDyVHD913W H+CA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=glJXmQPF; 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=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i11-20020a63bf4b000000b004b377960752si15629097pgo.353.2023.01.31.08.31.47; Tue, 31 Jan 2023 08:31:59 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=glJXmQPF; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232228AbjAaQbL (ORCPT + 99 others); Tue, 31 Jan 2023 11:31:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231792AbjAaQar (ORCPT ); Tue, 31 Jan 2023 11:30:47 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 993D45924F; Tue, 31 Jan 2023 08:30:19 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 28F7F6159B; Tue, 31 Jan 2023 16:30:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9A963C4339B; Tue, 31 Jan 2023 16:30:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675182618; bh=HUp0DzrBJhEg098mAGHnx7aoj0shJFUV+i6XYx2y+04=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=glJXmQPFR7gkI3Otb6Fqq1xmx9UDK+8d6HwAbPdziOAvLmSdTu8uqBRr1eSjZsf/+ 7cfrWDuPZqm3XUx20I4TJcPB8Ng2D3tpJuEpZch6tstd2TZKHa6ZeUdDOW2LxmjD7/ C8UTTLVau2JxzlqZ6qbXTbIL2H4heE+hrvk7ZxE7oK6h9CaUt6Mgp5dYmUzU1P8dO/ vZ6aLOh9QNRXEE+TnmgqFeKQ6BonXMNW68yOYaiklCqV4Dsx5WSepTz9t9gA2FMV8v oFi/EZrsGisMHtzryQA+3DM+AJcsBHPW9/q8dMQ4G3CrfjRjN3WZ1W+JIx5B4n34P3 eIFg5qTw+6Nhg== From: Daniel Bristot de Oliveira To: Daniel Bristot de Oliveira , Steven Rostedt , Jonathan Corbet Cc: Juri Lelli , Clark Williams , Bagas Sanjaya , linux-trace-devel@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 2/6] rtla/osnoise: Add OSNOISE_IRQ_DISABLE option Date: Tue, 31 Jan 2023 17:30:03 +0100 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756556395349632988?= X-GMAIL-MSGID: =?utf-8?q?1756556395349632988?= Add OSNOISE_IRQ_DISABLE to the set of possible options in the osnoise context. Do not use it yet. In preparation for the hwnoise tool. Signed-off-by: Daniel Bristot de Oliveira Cc: Daniel Bristot de Oliveira Cc: Steven Rostedt Cc: Jonathan Corbet --- tools/tracing/rtla/src/osnoise.c | 6 ++++++ tools/tracing/rtla/src/osnoise.h | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/tools/tracing/rtla/src/osnoise.c b/tools/tracing/rtla/src/osnoise.c index 050a9997191c..6bf877ed8a77 100644 --- a/tools/tracing/rtla/src/osnoise.c +++ b/tools/tracing/rtla/src/osnoise.c @@ -842,6 +842,8 @@ static void osnoise_put_##name(struct osnoise_context *context) \ context->orig_opt_##name = OSNOISE_OPTION_INIT_VAL; \ } +OSNOISE_OPTION(irq_disable, "OSNOISE_IRQ_DISABLE"); + /* * enable_osnoise - enable osnoise tracer in the trace_instance */ @@ -906,6 +908,9 @@ struct osnoise_context *osnoise_context_alloc(void) context->orig_tracing_thresh = OSNOISE_OPTION_INIT_VAL; context->tracing_thresh = OSNOISE_OPTION_INIT_VAL; + context->orig_opt_irq_disable = OSNOISE_OPTION_INIT_VAL; + context->opt_irq_disable = OSNOISE_OPTION_INIT_VAL; + osnoise_get_context(context); return context; @@ -932,6 +937,7 @@ void osnoise_put_context(struct osnoise_context *context) osnoise_put_timerlat_period_us(context); osnoise_put_print_stack(context); osnoise_put_tracing_thresh(context); + osnoise_put_irq_disable(context); free(context); } diff --git a/tools/tracing/rtla/src/osnoise.h b/tools/tracing/rtla/src/osnoise.h index 04a4384cc544..5bb0dc998f58 100644 --- a/tools/tracing/rtla/src/osnoise.h +++ b/tools/tracing/rtla/src/osnoise.h @@ -38,6 +38,10 @@ struct osnoise_context { /* -1 as init value because 0 is disabled */ long long orig_print_stack; long long print_stack; + + /* -1 as init value because 0 is off */ + int orig_opt_irq_disable; + int opt_irq_disable; }; /* @@ -79,6 +83,8 @@ void osnoise_restore_print_stack(struct osnoise_context *context); int osnoise_set_print_stack(struct osnoise_context *context, long long print_stack); +int osnoise_set_irq_disable(struct osnoise_context *context, bool onoff); + /* * osnoise_tool - osnoise based tool definition. */