From patchwork Tue Nov 22 20:39:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 24571 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2429343wrr; Tue, 22 Nov 2022 12:42:52 -0800 (PST) X-Google-Smtp-Source: AA0mqf49h25APmr8ZOkWUw/e84AwqaRD32cpnoC4Uf/po6jEV1w5k3am4GGAxYCt0D86QsAGC/Hn X-Received: by 2002:a62:ee0f:0:b0:56c:8dbc:f83e with SMTP id e15-20020a62ee0f000000b0056c8dbcf83emr5417524pfi.41.1669149772612; Tue, 22 Nov 2022 12:42:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669149772; cv=none; d=google.com; s=arc-20160816; b=Peulz1PUMaWZXN5D1cdDF5XEt3O68xhfLAQBXxg9aPyxsJm1E6AQUtJEi+nll+GZYo n0I4DIz0Qfzww2yJQXynmn9IIHd61nGf1A3xIEZl7gsQLdLTSbXHwdtIvaN98jpHjPRi MgxuFkyKml9zQY8HRPpPBKbG5FEFcJ5LJglsvOYWP5yFM3ejjusT4DOhx1Gm26SLnWoa Gk56rfULLVo0wWPb6oZ4OzzJwrmxp5M/hJ7j0puWNXfvdXzHysV4RLpA94gTspKX3DSu gFBvsXdxRXPCE6cvPB0AZcvtC48TEdULoH+meY6lJesqr3/P0ngyP7I9x7YA0jNKEG9X Q8iw== 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=W7jmX+FThLeVpi+3BhWz0w+d1KV5RehgTEmg2RUMq2s=; b=vRfJI8IyTjNQceUljvKXiqVolgWL5iEiACFJ9NwKM5KbedwVqFOBfCKVIsfxQPnfR0 Hj8CRmQAILH6jG8BFLNe3wVv+1PDrGx76bFVPjjnq2fms/igwnhkvfUDAhw8T8NpxDBh S0jAGp3kXPASIAc3dsRG4T15DTO51r2b4w2qQAqLqasmBMOKDag0ioF7G+vPNJqHWj7v kIALqkzHIt2I7s98XiNMHFFVkMpsMyrJBaslR7lTwJwzSa6xl4o8axguT/37h2cRQyGj 3JN+KCAI1EotMztlJHaayWzVIc5zkckerMH9MGCRnF0jT8B7YVRmCbfcU0vtjOasiLbM cp4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=KO6Zo8Ff; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a7-20020a17090a854700b00212f86579f8si16788911pjw.111.2022.11.22.12.42.28; Tue, 22 Nov 2022 12:42:52 -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=@efficios.com header.s=smtpout1 header.b=KO6Zo8Ff; 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 S235085AbiKVUlq (ORCPT + 99 others); Tue, 22 Nov 2022 15:41:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234926AbiKVUj5 (ORCPT ); Tue, 22 Nov 2022 15:39:57 -0500 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B99D697D9; Tue, 22 Nov 2022 12:39:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1669149593; bh=7vURJNeXW9U22SN33WMla8+qcI4XLD3d3buEpebC6PI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KO6Zo8FfRfpxU3iNEwBJS8Lx1YxD9DnJ9LJL5kQ9gwyfcbW2fnKno/VlROUxSmcS2 IOeckpiiQzEGPEQlOEtN9Bu9bngTntC3umbr+YEscCP2z0GfRC/t+Zbfsr8LNDx5B1 zRx6pkIXVl1/9F6flzkgPQ8qBfKvT5okAZzCKejZjXN0UUtOnZliRlirNGb8f0FURz /tnQCWcL7DDS2T5He78GIHUFQ9cmdeU4fhhsnAkNzNcp3zwYPYegMLL9hFAvXZI+OS 3jfmFzd82pX46H7B8kd9q5mCLSEvM6Y4WXia+bRebXaAmzp65U5kOnr36yB8Zd9Z6A Su92sdhQw0amQ== Received: from localhost.localdomain (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4NGx2d1FZrzXP8; Tue, 22 Nov 2022 15:39:53 -0500 (EST) 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 21/30] tracing/rseq: Add mm_cid field to rseq_update Date: Tue, 22 Nov 2022 15:39:23 -0500 Message-Id: <20221122203932.231377-22-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221122203932.231377-1-mathieu.desnoyers@efficios.com> References: <20221122203932.231377-1-mathieu.desnoyers@efficios.com> MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750230391907122197?= X-GMAIL-MSGID: =?utf-8?q?1750230391907122197?= Add the mm_cid field to the rseq_update event, allowing tracers to follow which mm_cid is observed by user-space, and whether negative mm_cid 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. Changes since v5: - rename vcpu_id to mm_cid. --- 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..823b47d1ba1e 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_cid) ), TP_fast_assign( __entry->cpu_id = raw_smp_processor_id(); __entry->node_id = cpu_to_node(__entry->cpu_id); + __entry->mm_cid = task_mm_cid(t); ), - TP_printk("cpu_id=%d node_id=%d", __entry->cpu_id, __entry->node_id) + TP_printk("cpu_id=%d node_id=%d mm_cid=%d", __entry->cpu_id, + __entry->node_id, __entry->mm_cid) ); TRACE_EVENT(rseq_ip_fixup,