From patchwork Tue Jan 10 20:08: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: 41625 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2946887wrt; Tue, 10 Jan 2023 12:09:54 -0800 (PST) X-Google-Smtp-Source: AMrXdXuFJV4UfWjwAjPHmQ1q2ywOtkltWNtvzLiCC/QOL5exgfSRV/ZAaRuXbUQJMQjHQPmDTtRt X-Received: by 2002:a17:907:4d8:b0:7c0:9a2f:ac93 with SMTP id vz24-20020a17090704d800b007c09a2fac93mr47863220ejb.31.1673381393707; Tue, 10 Jan 2023 12:09:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673381393; cv=none; d=google.com; s=arc-20160816; b=hYIGz6xiGUTQaWTw+2s/qry3uZ1ZLE8tSgvk3hX9NOJt5XhCukV7Cx/WSP5CYQqKgn S8MZZLwbXxdfWRAb/dn7elqZza4+6MCAaJ6s8Dba9fYQQN3h1vLq5l4AMWp4L2izB72T EFiSGzSaXYEKrTIAnZdS7W4hucmEeHSBnlv4q5NFb9poIEZtefvdSysqTCpLILo0JTFI TvUejpza+RO0jUN3et3r0K4KdkKncNgFXtKCx12ceuP9yG6bkp+ysf5HRex/v+mTBqNr rKr3cFvq4E7/aPnyajE8frFFlOgpYHFjiB+WVmBPlwS/WTy0XFk46SoQB757IULE8VSk +wpA== 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=fet9bE9F+4zkO+nmNN3Lnj7UkZLChYkYiqbP3Su6mUgD1doPitK/Rip2gMUbNNz+7f BaioRMelA7OdrAJecHElVbFbBzOOpOCaYAKuci3+kTHI+GK5Oc1T6DNrFo1X0vWaLSXh HBTwP18ebVU+FRnMuKohMhUmf14XKTngJTfuPjNy7MI10MaazN+elBFIlPEji+1fsQ3X t8WNSP0XxNiYhlKtHyqAsJIiPlPXoTP4YV06Cx5PCG6RXkF3DYHvElrhyMnVEMboalH/ +wI5wGiGgAVZTUh2KC/9E6mkpnXRD9oWIXynm1lRGvQHESK1rRIhKZTAYp19PI+hftaE k99A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="mtJK/8Zy"; 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 gt33-20020a1709072da100b007c151fc73d0si15682314ejc.653.2023.01.10.12.09.27; Tue, 10 Jan 2023 12:09:53 -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="mtJK/8Zy"; 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 S233281AbjAJUIg (ORCPT + 99 others); Tue, 10 Jan 2023 15:08:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232999AbjAJUI1 (ORCPT ); Tue, 10 Jan 2023 15:08:27 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16FC62D1; Tue, 10 Jan 2023 12:08:27 -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 ams.source.kernel.org (Postfix) with ESMTPS id B9845B8197F; Tue, 10 Jan 2023 20:08:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 54B6AC433F0; Tue, 10 Jan 2023 20:08:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673381304; bh=HUp0DzrBJhEg098mAGHnx7aoj0shJFUV+i6XYx2y+04=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mtJK/8ZyfQbnMQeQJz+X37II6DDOdwT1bgc3lLt5k610wUyodg+S/r9YX4A7geXm1 HeKSKMSJDaOxwM/FlopIixGkhr6rFOp4rxK+gyI9gMvfAgzLokVx5ZgmEbusqFFm0Z ODJZLOOEWamxGPI610mEsEK61B8p2LvRiSDFlp+b506BBc7KZqmiSdfR6Sv7LxCMxn rLIRds/10H/qxXJhjqQTPhK/fPoxv0uXq3RZWd2xsxMKXn7EFOn3Ka3a1yDbgFPUl+ N6hf7i5tnlThAqxh6WL65r5q1WWJObJZH0JQV07teR26gTLKoILbc5npkiZwsKWf5I 0enJWVmFvmFTw== From: Daniel Bristot de Oliveira To: Daniel Bristot de Oliveira , Steven Rostedt , Jonathan Corbet Cc: Juri Lelli , Clark Williams , linux-trace-devel@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/6] rtla/osnoise: Add OSNOISE_IRQ_DISABLE option Date: Tue, 10 Jan 2023 21:08:03 +0100 Message-Id: <5e5cede08247fe55f4a66ac0f0d81d5549953395.1673380089.git.bristot@kernel.org> 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?1754667568279090414?= X-GMAIL-MSGID: =?utf-8?q?1754667568279090414?= 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. */