Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp771512lqo; Wed, 8 May 2024 14:36:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXOYMQYgiGtiN43OAwSsl3/XUmB8Q9GEsSke88F+nY0KZqiGZEoPMAOMZN8FRmkFLVgqfBXA8hHxLGrsdvpRkiOhviXNiYwRmDia+yqRg== X-Google-Smtp-Source: AGHT+IGWigDyNnGgP8P1NfSwdLr25z3jq8d0Ljn50DdjPmwQhDpH2/NBjNC7bUWE8xTop94reOKS X-Received: by 2002:a17:902:654f:b0:1ee:c491:ab62 with SMTP id d9443c01a7336-1eec491ac25mr26521445ad.25.1715204167513; Wed, 08 May 2024 14:36:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715204167; cv=pass; d=google.com; s=arc-20160816; b=IwcKWAF1m/zCrsGYDQCx9U0DsNJrlJumFMeSq0AqpBLGrTMRKSjMRydMKzD0B4ej9P CFzYRhKh0Oz0/z098qa+PgB3noexgfAyoijtq2pNp3JfIdZeY8SRNzRgBEJsFjhPpiFo an+o9VuS6eSjVe2FsFGlwTCuWAj0LnUaFGdr2ziBIwKUhAzUhzWf6Tyb9SE8/cidlj4V dFupk11PxKHdNzPFrBjqaYnvIsjuebStQSZztUdHoYUZXsXdVh1WGysMT9/9j9FODSa+ njMiBRS1LwyGff8eDbGO2zj1VE9bNS+Sujys7UzJKtNV8b1EM+k5EFLivsjdAbIek+Ut 4mkA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:user-agent:from:references:in-reply-to :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=3gYCZ7oFAMec1ZrgXeVWypvnMbMyJT9MYWUz9Y1dIg8=; fh=AVekkWT/KmdvzMFJuhi3z++fUP+F+bPqfnTjcXgulvc=; b=vl3qlZH46dxhU2TCQRh8cCqb1IfL/DJsi3aosMrL+dWwpRqOffj7HaZYzNK2uqYjRm 7f+xox7w9nDMrp3IhlvhqDRIeEOvC1wxOeUfZ3vfxC9fUUNxG8m4NCeHTFdT2YvMiWoa jqhGoIzrbkPh5aK1ODyvXca5F+ivC1alfyKALbyp3UzVZBk9tvN4wQ5T50MeynnQXLch iRElgzCfZC8PRet6rlsRRI7PoVaIvIT8mRsjvHjx2hwCJ6USXELTYPjYNSyVWfjNTwe0 7tUreI/+6CFTlgto3GrbIN3n3AjC9ZDlOJtj8AJh7xCjmRWz9sOak0+osCMQSvH6uf7F 9Ajg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=USm7C+JN; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-173845-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173845-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0c15e33bsi227825ad.529.2024.05.08.14.36.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 14:36:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-173845-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=USm7C+JN; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-173845-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173845-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 247E5B21801 for ; Wed, 8 May 2024 21:36:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5AB4C131728; Wed, 8 May 2024 21:35:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="USm7C+JN" Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) (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 003353A1AB for ; Wed, 8 May 2024 21:35:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715204156; cv=none; b=eCsuw9EO8h122HBGg6xRSlYitWGGPtFot8tt2K3sV7T6D6Es6wJUHe93ZMdEkaaPkgwuzb8MMagYhvWQoLLr1sNeFsVG/vOAf7D2YPIyvfZp2TZmbI5IIeZJGo0+INJXza+3MinIZbKldS2QYEmc1L0Pw7W+2KywPqRbxF3wqRY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715204156; c=relaxed/simple; bh=TItpyl1t0DXLCCEbXrOYaW4CWjE/M37i078bhWzEMyA=; h=MIME-Version:In-Reply-To:References:From:Date:Message-ID:Subject: To:Content-Type; b=k8kwbbz8XABoYKAzzmIpWQZo3/oIQYjBTBFO9yEGhIOMVoF4bWeG5f5BpVk92iz1gsjRQFMk6v34Pg6FIafDPYyLRigNNfXNvxw0uR8TCTAcWc/hvF+K5paQPfKgEr3uspG8AxQf5eu6A/6kDk5VrzNCKmIp/QI9du+ikTvSbnc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=USm7C+JN; arc=none smtp.client-ip=209.85.219.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-qv1-f52.google.com with SMTP id 6a1803df08f44-6a0b68733f5so1953306d6.1 for ; Wed, 08 May 2024 14:35:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715204154; x=1715808954; darn=vger.kernel.org; h=to:subject:message-id:date:user-agent:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=3gYCZ7oFAMec1ZrgXeVWypvnMbMyJT9MYWUz9Y1dIg8=; b=USm7C+JNWffsKHNigWyJbeDSzgGm3DZCzC+sZy9D8jpibta/G6OrF4QwVVvNDf/1fH 1n14rpOztosk0q73Eq4ONepjz6GG/nYlcQHmJfkASVTUbbmEZ+Ah5YnW8RwUey2yq7A0 0tUodQ5HPLd3+vLzkBpZACbfiMKWvGSNKECu8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715204154; x=1715808954; h=to:subject:message-id:date:user-agent:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=3gYCZ7oFAMec1ZrgXeVWypvnMbMyJT9MYWUz9Y1dIg8=; b=dUR6EXfr1H2XrALwsMtQWXj8SFvsh6vVb3k6k/xwxNnD5IoBfR8bSRHkit5DkiUW8x BZhqL9U2kuPI7zMYfZZWysBmrw1TTrBkKs6/YWSNAG/3XdormOZHTuRuLMrwklg0NfFu f6T/kYGnydwZJeJFscXINN2Vu7c6Ift3ooNG+6QAocJf4b/YbDred5D7e3MNvC1DQxZC nT14pvz1+4lWsdHgEWmWa8UAUeBHN9t+VJkUwoJjJMp8s8O4RMw6h8h3lvF8hF4fwDzh xPvEKtOsFEezlVYzUwHNxM1JQpl9PMkrfFIdQG2LC8D3aeyFILv05soUEqyd2h0M+nHJ FlYQ== X-Forwarded-Encrypted: i=1; AJvYcCVQYvRHiHoly10/s7l52fEJ+42j162aiPwFavoebwfNwRx0Sz5oRJZgJtK+OD4ArBAm0D1ETOy0PrH6QAZvoMfx8j2lZiNuyLQUEf+r X-Gm-Message-State: AOJu0Yw2TSqI7tzMT2nY1ooBaCFlfAg5WNWdms85VsuJc9zBwSoQ1h7o y422JqPIhmFhVEuqYd9rVwDX/Hh9ipGRKQ4meDFk6bckaytCQdVrmUzqX+OwPAPvrqWi0LZ/Z85 lYNTSLdkqYXcziuliW1t+88tzZEqXK0hOYvVK X-Received: by 2002:a05:6214:d88:b0:6a0:ce1b:e75f with SMTP id 6a1803df08f44-6a1514bd656mr44299346d6.45.1715204153925; Wed, 08 May 2024 14:35:53 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 8 May 2024 17:35:53 -0400 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: <20240311-decode_stacktrace-find_module-improvements-v1-1-8bea42b421aa@bootlin.com> References: <20240311-decode_stacktrace-find_module-improvements-v1-0-8bea42b421aa@bootlin.com> <20240311-decode_stacktrace-find_module-improvements-v1-1-8bea42b421aa@bootlin.com> From: Stephen Boyd User-Agent: alot/0.10 Date: Wed, 8 May 2024 17:35:53 -0400 Message-ID: Subject: Re: [PATCH 1/3] scripts/decode_stacktrace.sh: remove find_module recursion and improve error reporting To: =?UTF-8?Q?Alexis_Lothor=C3=A9?= , Konstantin Khlebnikov , Luca Ceresoli , Sasha Levin , Thomas Petazzoni , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Quoting Luca Ceresoli (2024-03-11 08:24:54) > The find_module() function can fail for two reasons: > > * the module was not found > * the module was found but without debugging info > > In both cases the user is reported the same error: > > WARNING! Modules path isn't set, but is needed to parse this symbol > > This is misleading in case the modules path is set correctly. > > find_module() is currently implemented as a recursive function based on > global variables in order to check up to 4 different paths. This is not > straightforward to read and even less to modify. > > Besides, the debuginfod code at the beginning of find_module() is executed > identlcally every time the function is entered, i.e. up to 4 times per each s/identlcally/identically/ > module search due to recursion. > > To be able to improve error reporting, first rewrite the find_module() > function to remove recursion. The new version of the function iterates over > all the same (up to 4) paths as before and for each of them does the same > checks as before. At the end of the iteration it is now able to print an > appropriate error message, so that has been moved from the caller into > find_module(). > > Finally, when the module is found but without debugging info, mention the > two Kconfig variables one needs to set in order to have the needed > debugging symbols. > > Signed-off-by: Luca Ceresoli > --- Reviewed-by: Stephen Boyd