Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp2161998rwi; Thu, 3 Nov 2022 13:29:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7BBuTPaddRAxohVVEaiUN0JRPyahzNIEWIESj4zsJqD7OeQcSyzBUmqeYVudNCiaze0nd5 X-Received: by 2002:a17:902:e8cd:b0:186:9efc:6790 with SMTP id v13-20020a170902e8cd00b001869efc6790mr31895015plg.91.1667507392580; Thu, 03 Nov 2022 13:29:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667507392; cv=none; d=google.com; s=arc-20160816; b=y+xkv+BGtvZk50NLqvzxA/M/64Io+MULqmNs6biGdpjOwNXfggab2MHgpqRI2IhNsL XTfn6Av7P//dKxEz+NfUJGQ1/mmZ3Sv1lvH9PtJxtomK3VR9B8A2YCSo1hCRBU1X5z+o 2q2NXfn9g93LPe9rtGRY+gtpI08cci+t+ohQX4Jp8JLQmQxzIAYkC2XHjOwMXWtTFM1o VvctyxnEU/pqz4jmmqoAW5pknEaWPY1P/BtOAtEiODGCaeP0POd1I5pwfrJkqtP5hIIl 8ZdroAyCv7p/TgW905kgticmbFNcnF07CvB67m+KAUXXaGajMwCQu4KaYlB337DAul3B XmLA== 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=6wZqOwBg6XiUXuMbIBbhsQRVBve1Gtg+LcTlrBEXirk=; b=Mgdw3FqV6PzzFh9ZTVC5fluncJij6PYm62xgLfoIM6QafTgSH+67KVd5pBdwq03zlD voJ8IhrTjiefRv3b3GX2lOIHIOcLFPhJkwHL/iqsessXQREqCHPSw7HGQqH/M15gxAuK Bx9PPhVrLCW6NU0rVwjFZ2haieUhefgrUbYo95o/6/zxd2VtCj+l2175cRpr0JCN1yYM Pgi12IVJU695sH+n/flWC9A5UMVdcE2aMbnte28hmvLMl/NXhnT75n8ZUfwOuqAfwX97 TICPZS4uL6UwDKKbm5zuZGyQJJruLDKDlNVYnSU1Ca9UT66l6NcU3rAEbROi+ANa4Gwd /U6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=PWQg3Ja0; 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=efficios.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c7-20020a631c07000000b0043adff6d43dsi2213490pgc.583.2022.11.03.13.29.40; Thu, 03 Nov 2022 13:29:52 -0700 (PDT) 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=@efficios.com header.s=smtpout1 header.b=PWQg3Ja0; 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=efficios.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231779AbiKCUGk (ORCPT + 97 others); Thu, 3 Nov 2022 16:06:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231406AbiKCUFQ (ORCPT ); Thu, 3 Nov 2022 16:05:16 -0400 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 966E720351; Thu, 3 Nov 2022 13:05:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1667505904; bh=aR1TngvqLe/BAXphPiGrYuVRVX1HfRtNdx1hDFAPet4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PWQg3Ja08w7tehAIfnZJG2X+jbNNV0LOW/2QASiuHNfAM2VmmZGoY/+YIrT/Di+eI 6DsA/+fJZU166nuFx2aXOatrryNqphLlbt2+Se9KDHhhPT1U/i2vevLjTRWX9uK6X4 KIDFEAIyqnvbN58iYWGQFuh6eeumXa7Yh+uJuLeP44zayVMoN3SAcX6+y1iDy145m/ 22s9A/svxDSfCFIGbNUe7lJ9MDifyIRxQ7h+CW8ZCMT4E9OBk/iCiS7Q+iPQSqMTq7 CDDbXTDa+pDg6zPqk+mRsBvUfuE/6/bzkpGh8n/CYl1vef5EQzwu27jDdZSRFpJk2o QUlzpj03S6zmg== Received: from localhost.localdomain (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4N3F9D3PmYzg72; Thu, 3 Nov 2022 16:05:04 -0400 (EDT) From: Mathieu Desnoyers To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, Thomas Gleixner , "Paul E . McKenney" , Boqun Feng , "H . Peter Anvin" , Paul Turner , linux-api@vger.kernel.org, Christian Brauner , Florian Weimer , David.Laight@ACULAB.COM, carlos@redhat.com, Peter Oskolkov , Alexander Mikhalitsyn , Chris Kennelly , Mathieu Desnoyers Subject: [PATCH v5 24/24] tracing/rseq: Add mm_vcpu_id field to rseq_update Date: Thu, 3 Nov 2022 16:03:59 -0400 Message-Id: <20221103200359.328736-25-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221103200359.328736-1-mathieu.desnoyers@efficios.com> References: <20221103200359.328736-1-mathieu.desnoyers@efficios.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 Add the mm_vcpu_id field to the rseq_update event, allowing tracers to follow which vcpu_id is observed by user-space, and whether negative vcpu_id values are visible in case of internal scheduler implementation issues. Signed-off-by: Mathieu Desnoyers --- Changes since v4: - use task_mm_vcpu_id() to get the mm_vcpu_id from the task struct. --- include/trace/events/rseq.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/trace/events/rseq.h b/include/trace/events/rseq.h index dde7a359b4ef..9106148227c0 100644 --- a/include/trace/events/rseq.h +++ b/include/trace/events/rseq.h @@ -17,14 +17,17 @@ TRACE_EVENT(rseq_update, TP_STRUCT__entry( __field(s32, cpu_id) __field(s32, node_id) + __field(s32, mm_vcpu_id) ), TP_fast_assign( __entry->cpu_id = raw_smp_processor_id(); __entry->node_id = cpu_to_node(__entry->cpu_id); + __entry->mm_vcpu_id = task_mm_vcpu_id(t); ), - TP_printk("cpu_id=%d node_id=%d", __entry->cpu_id, __entry->node_id) + TP_printk("cpu_id=%d node_id=%d mm_vcpu_id=%d", __entry->cpu_id, + __entry->node_id, __entry->mm_vcpu_id) ); TRACE_EVENT(rseq_ip_fixup, -- 2.25.1