Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp840044rdb; Tue, 23 Jan 2024 17:39:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IGKtZmf5q/7PTJSi9vnELNuK7EoSbTibSMR+nvFKSPXCZM/7JVKdpoHSbCivprTYbGTX7lf X-Received: by 2002:a05:6214:d63:b0:683:967d:96b with SMTP id 3-20020a0562140d6300b00683967d096bmr799307qvs.31.1706060349564; Tue, 23 Jan 2024 17:39:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706060349; cv=pass; d=google.com; s=arc-20160816; b=Er6hsOnyTCH7+VUMWUN5PF5JSrcVlXnHYTFOFtEtckk44E1vdRjoYwPm3KPnidomkx 8aVo7ykQh3Ljum5nNj0YhpnCCDxiYOQm8dsVbUnbgCYzKRg8hAz+qAgwifmk3GbQLX4m E3t2FEnGqSvMuIHuTqRLbLUwHUPOK1AS+Xr6L5AZUm/H6dFWgP+JImgl8NYv4JAulZTi P+lq4+2p7Fw3xThHeXr4mhLRbVQvfSY1fSCrO/DdaWmlBvYwTDc84RUUyYaaFx/Zfpll 7I/wB2SOHtJRz6i8kPs2sg3Ryqu7wdsiWAg2wJ3krxQlv8X5oqbtr+ESfil79MEvQ8sL 9m9g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date; bh=z46UuNMx0TVE/ZcX1HI8575miRGXOsyKndQOmmNmM4o=; fh=eIcH3troZ6jbtWtfSc0FGykGis5USUzkoWMLqKWfxPw=; b=Iwxe5sp8ilrHdCgJdQscTCX6kFtolNmZx0H5Cys7DlqMWYQ0QUiyYy7BHRZECpHqYv vU5dwFBoYM+higx077zZ5GAMFlc6fSZyVzfUxyPLyHe6dGTOXxIrvF8YvJ3vMa8WzE7N 5AqvuMQpCcHQn/xf71LcaFzZMSsrA3zy7mtaaHm09WDLPH+w+Sj501wQ4gjkqNJDSj2a AMsZB88pxLRgfeCc9nc+GrRGCz4NMfZLS1W+skux9NaV6k1vH5P3HIUduc/T92G16Czw 1ZWk0tECKaDnMvqc3r++OAc8l0a6dxLrtzGn5mvVrT1Ee7hGzMdH6mmyyKUVgnRr+2FO vN6g== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-36281-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36281-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id x1-20020a0ce241000000b0068178184b48si9426354qvl.70.2024.01.23.17.39.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 17:39:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-36281-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-36281-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36281-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 552D11C2398A for ; Wed, 24 Jan 2024 01:39:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6CE4A17CF; Wed, 24 Jan 2024 01:38:59 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E22D220E6; Wed, 24 Jan 2024 01:38:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706060339; cv=none; b=VY9J2QJqTK8Ca7dWYFZqYpl4ZrG1T0JFzk7e8G7BRKyWuopqVaI3w7w/6vHUnU4+Ziq10210g6VyU+0e8taKMj9PZ8BVEMvuGGy2FX7WgtVyTvyIwJd/7Mto4AoPGe4QOvV7zr6aEqrIjhE58+49aUXrDH+lh7cE+eSwxSBBq5U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706060339; c=relaxed/simple; bh=T/SApjS4NcwCV6e9qX6lfk7qF4ETSE5E2S3aJnDWIjA=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=GH+1S5IGCRxl/nOwi2gNht2YynZcnCaZuPHiChyE7a1ZzQv43jlddyatpzJfnMqtNQGu705xtRL6JAQAujlAojixSMQsNdGp5SATKMLfCaXHpH+Ppa1XOQYViRDKNbU+V/7VNmTXnwaLNcQBqG3zN1kZ0CJjONod1yYNr4okYAM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0D956C433F1; Wed, 24 Jan 2024 01:38:55 +0000 (UTC) Date: Tue, 23 Jan 2024 20:38:53 -0500 From: Steven Rostedt To: "Naik, Avadhut" Cc: Tony Luck , Avadhut Naik , linux-trace-kernel@vger.kernel.org, linux-edac@vger.kernel.org, bp@alien8.de, x86@kernel.org, linux-kernel@vger.kernel.org, yazen.ghannam@amd.com Subject: Re: [PATCH] tracing: Include PPIN in mce_record tracepoint Message-ID: <20240123203853.66655e95@rorschach.local.home> In-Reply-To: References: <20240123235150.3744089-1-avadhut.naik@amd.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 23 Jan 2024 19:29:52 -0600 "Naik, Avadhut" wrote: > > But some questions: > > > > 1) Are tracepoints a user visible ABI? Adding a new field in the middle > > feels like it might be problematic. I asked this question many years > > ago and Steven Rostedt said there was some tracing library in the works > > that would make this OK for appplications using that library. > > > > I think they can be user visible through the "trace" and "trace_pipe" in > /sys/kernel/debug/tracing. But you will have to enable the events you want > to trace through /sys/kernel/debug/tracing/events//enable. > > AFAIK, this (adding field in the middle) shouldn't be problematic as we > have the tracepoint format available in debugfs. For e.g. with this patch, > the format is as follows: > > [root avadnaik]# cat /sys/kernel/debug/tracing/events/mce/mce_record/format > name: mce_record > ID: 113 > format: > field:unsigned short common_type; offset:0; size:2; signed:0; > field:unsigned char common_flags; offset:2; size:1; signed:0; > field:unsigned char common_preempt_count; offset:3; size:1; signed:0; > field:int common_pid; offset:4; size:4; signed:1; > > field:u64 mcgcap; offset:8; size:8; signed:0; > field:u64 mcgstatus; offset:16; size:8; signed:0; > field:u64 status; offset:24; size:8; signed:0; > field:u64 addr; offset:32; size:8; signed:0; > field:u64 misc; offset:40; size:8; signed:0; > field:u64 synd; offset:48; size:8; signed:0; > field:u64 ipid; offset:56; size:8; signed:0; > field:u64 ip; offset:64; size:8; signed:0; > field:u64 tsc; offset:72; size:8; signed:0; > field:u64 ppin; offset:80; size:8; signed:0; > field:u64 walltime; offset:88; size:8; signed:0; > field:u32 cpu; offset:96; size:4; signed:0; > field:u32 cpuid; offset:100; size:4; signed:0; > field:u32 apicid; offset:104; size:4; signed:0; > field:u32 socketid; offset:108; size:4; signed:0; > field:u8 cs; offset:112; size:1; signed:0; > field:u8 bank; offset:113; size:1; signed:0; > field:u8 cpuvendor; offset:114; size:1; signed:0; > > print fmt: "CPU: %d, MCGc/s: %llx/%llx, MC%d: %016Lx, IPID: %016Lx, ADDR/MISC/SYND: %016Lx/%016Lx/%016Lx, RIP: %02x:<%016Lx>, TSC: %llx, PPIN: %llx, PROCESSOR: %u:%x, TIME: %llu, SOCKET: %u, APIC: %x", REC->cpu, REC->mcgcap, REC->mcgstatus, REC->bank, REC->status, REC->ipid, REC->addr, REC->misc, REC->synd, REC->cs, REC->ip, REC->tsc, REC->ppin, REC->cpuvendor, REC->cpuid, REC->walltime, REC->socketid, REC->apicid > > > Just quickly tried with rasdaemon and things seem to be okay. > > Also, not a cent percent sure, but the library you are mentioning of, I think > its the libtraceevent library and IIUC, it utilizes the above tracepoint format. > Yes, rasdaemon uses libtraceevent (or a copy of it internally) that reads the format file to find fields. You can safely add fields to the middle of the event structure and the parsing will be just fine. -- Steve