Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp883764rwb; Fri, 18 Nov 2022 09:28:37 -0800 (PST) X-Google-Smtp-Source: AA0mqf4OhvPbYMAt2O36rfENxEmZPWUA2u0IXKC+Yu2IC40avqnAtRa1jKMl7YMfmRvwUdHdN6Pg X-Received: by 2002:a17:906:c052:b0:79a:101a:7e57 with SMTP id bm18-20020a170906c05200b0079a101a7e57mr6803389ejb.368.1668792517489; Fri, 18 Nov 2022 09:28:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668792517; cv=none; d=google.com; s=arc-20160816; b=fog4nsPa4DvnMOLAEcFurgBlko+fJB4jrIufsglH/Ktg5KiCjkK0HLgkw3VjXjO24u ZQHipB5ZSiqDHWAa84d7ZpvHtinOKnt6Rnj37FTAJqvgt/Z8gOZdbvVGkZO3HQl00rE0 OH38h443fxlMtR3Vl8ElaUGEqlWWP92uEEQa2i+Ql4jvC+I4F2saR8WmmiFBtd/d8VIa G/lZ27jXdhQXrPL0nJLgxkSuAwmO2UH8U0TTy9qTpLFuYjRP5w02Ca9A8o8qLCrObeSo PDnFqLfF33I132qPSgHcIDwsI6dyI0ABEgJnN0xXjJKWnfQ40ryDuCt3UxuNerlIhU0F G+Ow== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=4/lZAnOXPkFaHnGFixuznrXc+fqvh+fQumPEYd2UgBU=; b=afMEV7Pualk8CPZJJLEY0u+QTVWFuWff7k/gQazoxzalvqRsuyi/37ftlvkeedlTlL Eni+Qc/C1GplZxI4osjTanf1IpYozwwpG9QCzPnS1mtNp6FuxFnWT6jiKwLW9ZdFsVos glGM5J3TjwPpcTOnui5z0p1ebIy9xLuAjIzzY2m7pSrtHbVJlQtikMhWupJ1+NLTsgr0 suMpW6JfwILkJh2oq8t8aEuKeujsXLfpZ7F+pkn+lXBI5wjhmr+JNjban8eaPuzoRXAT kHMyhTC43ej2dp2RIePE4R+7Fr4rTzKof0cr0y2WjNDAGdvw1aG/j7lREg/rW68VBCJI p3gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dkVV+d6r; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x8-20020a05640226c800b00461540620f1si4037681edd.169.2022.11.18.09.28.14; Fri, 18 Nov 2022 09:28:37 -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=@redhat.com header.s=mimecast20190719 header.b=dkVV+d6r; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241449AbiKRQVs (ORCPT + 91 others); Fri, 18 Nov 2022 11:21:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241377AbiKRQVl (ORCPT ); Fri, 18 Nov 2022 11:21:41 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE503922E5 for ; Fri, 18 Nov 2022 08:20:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668788443; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=4/lZAnOXPkFaHnGFixuznrXc+fqvh+fQumPEYd2UgBU=; b=dkVV+d6ryflCp+S2R2jUNE8Sd51hoOiAxQIIl5t4feFmDoDLNXQjHSHAu0OInr31oQBgNp ahxg+qSa8dCBXvXB/iR4ic/cn/IWirhkjgDxwgPGQb505SwfpqB4NVS8xfb9CkBmaBWPJa Seb4tDV1uNnTS4UD0CT6hHUVPM40n14= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-158-TjDb6TtZOKa9hyZboHluxQ-1; Fri, 18 Nov 2022 11:20:39 -0500 X-MC-Unique: TjDb6TtZOKa9hyZboHluxQ-1 Received: by mail-ej1-f72.google.com with SMTP id xc12-20020a170907074c00b007416699ea14so3301892ejb.19 for ; Fri, 18 Nov 2022 08:20:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=4/lZAnOXPkFaHnGFixuznrXc+fqvh+fQumPEYd2UgBU=; b=vNihDanxqnRb+kYPpelo9NFOvZ7z7+xUfajAabAOPKWDuAfv/MYzwhkKdyNGW+bjLu iSSfEl84L0qccNR0H5cZZRM3eDJbQSFPa0g4RbPYMhc+xuHV3cKUcjnihbsJY/H7CXSI 4vyIuUCAPJf51aRErxFiDD12JQBzpYq4sspzY3g/XH/hNSS0stIV22sDmccKaubkX3Mg pxtwT95Zm0Kd51+/wSa90lDQ72/4sj/QpuXdURauHLRQCqDbRpwHCE712/HfpyznjB+c oZBVyyDXBBlUgbvKHmbKuVhy8trufF1CSdWDWnH5LNDtndPnCT01KRQTw9StPFsaktyT qNIg== X-Gm-Message-State: ANoB5pnxLaCKDflESDVRZTP1vg0bQDjnNwi0L8mOMTkNQmsQiWBG2kob oRmvs7MUP08Qk2JEXKQM1x7OwVvFOlm0AE5K6W6CiqHt+xFffqKRK3vpKxO4XWx/S0oqEjkCsnv PLMQ0xlLHVaXW3LPkNjemdLsq X-Received: by 2002:a17:906:32c7:b0:7ad:934f:abc2 with SMTP id k7-20020a17090632c700b007ad934fabc2mr6130437ejk.690.1668788437934; Fri, 18 Nov 2022 08:20:37 -0800 (PST) X-Received: by 2002:a17:906:32c7:b0:7ad:934f:abc2 with SMTP id k7-20020a17090632c700b007ad934fabc2mr6130419ejk.690.1668788437651; Fri, 18 Nov 2022 08:20:37 -0800 (PST) Received: from x1.hqhome163.com ([194.183.10.152]) by smtp.googlemail.com with ESMTPSA id l19-20020aa7cad3000000b0045bd257b307sm1970007edt.22.2022.11.18.08.20.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Nov 2022 08:20:36 -0800 (PST) From: Alessandro Carminati To: linux-trace-devel@vger.kernel.org Cc: alessandro.carminati@gmail.com, acarmina@redhat.com, bristot@kernel.org, rostedt@goodmis.org, linux-kernel@vger.kernel.org Subject: [PATCH] rv/monitors: Move monitor structure in rodata Date: Fri, 18 Nov 2022 17:20:33 +0100 Message-Id: <20221118162033.66389-1-acarmina@redhat.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 It makes sense to move the important monitor structure into rodata to prevent accidental structure modification. Signed-off-by: Alessandro Carminati --- kernel/trace/rv/monitors/wip/wip.h | 2 +- kernel/trace/rv/monitors/wwnr/wwnr.h | 2 +- tools/verification/dot2/dot2c.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/trace/rv/monitors/wip/wip.h b/kernel/trace/rv/monitors/wip/wip.h index dacc37b62a2c..9c0cd0ad5cd7 100644 --- a/kernel/trace/rv/monitors/wip/wip.h +++ b/kernel/trace/rv/monitors/wip/wip.h @@ -27,7 +27,7 @@ struct automaton_wip { bool final_states[state_max_wip]; }; -static struct automaton_wip automaton_wip = { +const static struct automaton_wip automaton_wip = { .state_names = { "preemptive", "non_preemptive" diff --git a/kernel/trace/rv/monitors/wwnr/wwnr.h b/kernel/trace/rv/monitors/wwnr/wwnr.h index 118e576b91b4..57dfb1c46cb8 100644 --- a/kernel/trace/rv/monitors/wwnr/wwnr.h +++ b/kernel/trace/rv/monitors/wwnr/wwnr.h @@ -27,7 +27,7 @@ struct automaton_wwnr { bool final_states[state_max_wwnr]; }; -static struct automaton_wwnr automaton_wwnr = { +const static struct automaton_wwnr automaton_wwnr = { .state_names = { "not_running", "running" diff --git a/tools/verification/dot2/dot2c.py b/tools/verification/dot2/dot2c.py index be8a364a469b..512c7a11830f 100644 --- a/tools/verification/dot2/dot2c.py +++ b/tools/verification/dot2/dot2c.py @@ -111,7 +111,7 @@ class Dot2c(Automata): def format_aut_init_header(self): buff = [] - buff.append("static struct %s %s = {" % (self.struct_automaton_def, self.var_automaton_def)) + buff.append("const static struct %s %s = {" % (self.struct_automaton_def, self.var_automaton_def)) return buff def __get_string_vector_per_line_content(self, buff): -- 2.31.1