Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp675842rdd; Tue, 9 Jan 2024 16:55:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IE1VeexILqE1U2KfGqkz2v3vbFLZrL8DFUI7QinyQCR4T0PRQv9U/4Z6QrGrvHjXQfyrRfg X-Received: by 2002:a05:6a20:7285:b0:199:dc2d:3dc8 with SMTP id o5-20020a056a20728500b00199dc2d3dc8mr222354pzk.15.1704848122305; Tue, 09 Jan 2024 16:55:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704848122; cv=none; d=google.com; s=arc-20160816; b=MvMCFPxVcjw5uLiMUchcbcQK2asLhXspDbw/IV6Zklb/caGwYgQmMseYg4pJbHAeYs knVZX8hPsd5zv2JMtF0EgTyyPq28bk/ODQJsk8zgRYmZMUABzUkjA+KzHr3aqVH8KguR rtpdsrFodS0Ae0xGAUF3CtKI50tyTklHfV2WuFu/MtcJsOLx0zjmMSMiDoLhlpcI9gvk 32PzkmaxTdUfm3Ycj8CfedeiUd+U3t1OVUhAuzUSKdAc5KhtJGYltX60SK20Wk5p9RUt ACgqCzkNe64KRovHjqgRPohKDeFUSmJh7GY/v1bJCdlHpFVT+j78IsxBS9GWgVBLxJHb lINA== ARC-Message-Signature: i=1; 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:message-id:date:subject:cc:to :from:sender:dkim-signature; bh=bgsQ4MWW5/DZVSlFzeBPrIni0TrETXMOxQj1QIRmig4=; fh=z18jmCeiqZl0cDd9eNmR5B4sfj6fak0FZOOHaBik7E8=; b=MYhnf7hFr9Yl6pEeMWzzW7DCIBmAPmPLwcOfzkfMirlI3TQxhtv2Lp4+WEF/NDTa5y SvcmzkdCviRMmtLbGv38sG+dGYCgkP5SH9qFNzWQJMv91om101siPtO17IL7dHPL0b15 LcD1Xxf/1UjKwFL66PHzsxs+B+EWmO/PDEM+s/IC4U/C0uHWErx0oQeAPrQVcMxrZKpP yy/x8KVD3R4901u33fUfP/3GKxRIXr77l/splc8ie+B3BvsEWA5D86NOHB0epubU4r2H ZPMxfUFDO2bs/RrY4oFXl/tPwJym1zv4I9fJjOfHdKUIN+WYjlR40TKBCZAOL3oPQ0cF N19A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="gdzn1Ua/"; spf=pass (google.com: domain of linux-kernel+bounces-21597-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21597-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id fb16-20020a056a002d9000b006d9d2ba854esi2567765pfb.177.2024.01.09.16.55.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 16:55:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-21597-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="gdzn1Ua/"; spf=pass (google.com: domain of linux-kernel+bounces-21597-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21597-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 8F0482875AF for ; Wed, 10 Jan 2024 00:55:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3742E15D1; Wed, 10 Jan 2024 00:54:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gdzn1Ua/" Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 016A2391; Wed, 10 Jan 2024 00:54:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-1d3aa0321b5so32410045ad.2; Tue, 09 Jan 2024 16:54:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704848087; x=1705452887; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:from:to:cc:subject:date:message-id:reply-to; bh=bgsQ4MWW5/DZVSlFzeBPrIni0TrETXMOxQj1QIRmig4=; b=gdzn1Ua/Jz2KX+E+DxxQrgyq0KXLX7cGyz1bwnMdsDubyRmCkzetSolLIZyIstXki2 mmx3kOdcymnYvQOYf1YWo2G4QdAjdKeOBmOj526xuF+1k+jAgNk74+XKWCivyqKTIWOt MxY/rRjr6/R/UvmxaOGmeNHOdQ/OvFzrS3ovmXPBXhUxxWdVGVX0jxS90OmWTwVqKgIr hh6PsSGlTn+FjeYmK5uy0P4Xzd39u/Ww2mDC7fCoYSRvKFBH+RDNEKVcdMp3CYDlwloR 0RywCopeQxnWshMLLi1BZP7RBIlcDF8lelJdGCJLBRqHEHcRg7Taumod23OP0t/wz9ai vJnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704848087; x=1705452887; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=bgsQ4MWW5/DZVSlFzeBPrIni0TrETXMOxQj1QIRmig4=; b=Pcd1UeaFZMov9CYcn+qqRnOolr5VVS2T/cNazZZuNU2hoZ7d21sgM9BMSn704zmwSQ vvmSZrARWQwPg8jN4LtGmBDfvI9JXgxAOpVv3yLZsXTohRTq9oKJrD34ScIlocKqTcLp pCV8s42MFF8eFwIGE2TqFb58tzJpIsKLyCyBTIwgoN5QpN9uZuuJaqCzOhtW8S3eTZnF zyXI/uo7T2jUQCrPLrdUyb7ofcYhcF48CI2c9NfpGGThSQx/600y7158/Hu+5mvIheNg yj0dQn5V/1BwKIZL0bMAMkokJJfegem0K4jeGqorfrndqtc1yZ39UDrQpQq0iMGbTYNJ Rn0Q== X-Gm-Message-State: AOJu0Yzq1fJardb+rsPv3pITU6z8RyQ7DUlMVO0pBrDw5cn0UPagCtHK CBJWgfnFk57gLqpUM3EvA+E= X-Received: by 2002:a17:903:228c:b0:1d4:152b:dd8e with SMTP id b12-20020a170903228c00b001d4152bdd8emr243529plh.108.1704848087171; Tue, 09 Jan 2024 16:54:47 -0800 (PST) Received: from bangji.roam.corp.google.com ([2a00:79e1:abc:12d:b923:c723:30c0:8cd9]) by smtp.gmail.com with ESMTPSA id t13-20020a170902b20d00b001cff026df52sm2396147plr.221.2024.01.09.16.54.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 16:54:46 -0800 (PST) Sender: Namhyung Kim From: Namhyung Kim To: Arnaldo Carvalho de Melo , Jiri Olsa Cc: Ian Rogers , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org, Stephane Eranian , Stefano Sanfilippo , Steve MacLean , Pablo Galindo Subject: [PATCH 1/2] perf doc: Update jitdump unwind info specification Date: Tue, 9 Jan 2024 16:54:44 -0800 Message-ID: <20240110005445.490058-1-namhyung@kernel.org> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Currently the jitdump spec says the EH frame header is followed by the actual EH frame data. But in fact, it's the opposite way. I've checked this with the v8 javascript engine which, I believe, is the actual user of this feature. https://github.com/v8/v8/blob/04f51bc70a38fbea743588e41290bea40830a486/src/diagnostics/eh-frame.cc#L157 Also, the unwind_data_size field should have the size of both unwind table and the header sections. The jit_add_eh_frame_info() in genelf.c calculates the table size by subtracting the header size from it. Cc: Stephane Eranian Cc: Stefano Sanfilippo Cc: Steve MacLean Reported-by: Pablo Galindo Signed-off-by: Namhyung Kim --- tools/perf/Documentation/jitdump-specification.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/perf/Documentation/jitdump-specification.txt b/tools/perf/Documentation/jitdump-specification.txt index 79936355d819..5c3fbbbebf14 100644 --- a/tools/perf/Documentation/jitdump-specification.txt +++ b/tools/perf/Documentation/jitdump-specification.txt @@ -155,10 +155,10 @@ The record is used to describe the unwinding information for a jitted function. The record has the following fields following the fixed-size record header in order: -uint64_t unwind_data_size : the size in bytes of the unwinding data table at the end of the record -uint64_t eh_frame_hdr_size : the size in bytes of the DWARF EH Frame Header at the start of the unwinding data table at the end of the record +uint64_t unwind_data_size : the size in bytes of the unwinding data (EH Frame table and EH Frame Header) at the end of the record +uint64_t eh_frame_hdr_size : the size in bytes of the DWARF EH Frame Header at the end of the record uint64_t mapped_size : the size of the unwinding data mapped in memory -const char unwinding_data[n]: an array of unwinding data, consisting of the EH Frame Header, followed by the actual EH Frame +const char unwinding_data[n]: an array of unwinding data, consisting of the actual EH Frame, followed by the EH Frame Header The EH Frame header follows the Linux Standard Base (LSB) specification as described in the document at https://refspecs.linuxfoundation.org/LSB_1.3.0/gLSB/gLSB/ehframehdr.html -- 2.43.0.472.g3155946c3a-goog