Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4875600yba; Wed, 10 Apr 2019 06:48:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqz22kdk75Ejat5++fRiD13DpOxrYrvUX5AW7YxP+JB29kiI3kLmhO2KARS6xHbo5Gxwx4En X-Received: by 2002:a17:902:e407:: with SMTP id ci7mr43603482plb.219.1554904119120; Wed, 10 Apr 2019 06:48:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554904119; cv=none; d=google.com; s=arc-20160816; b=VXV9kUgDg2nPBM1gJSpOfOxo6Zn6COx5UHmpRw+q+OinMJqgDAKxAEUI3lDLFTCYLo 1/DtqNJ4RtkgvnmIH/YeGpyIh0ERebWM5IJV7u1TNdYCrCg9YoMSVW33HTMxcLbpZKHc +DL0w38P13X6gNmbXhYdv0x0UEXmxsiSRKEJb+6KomfMXBv19C8k7JtSXa9gautrZi8s mskYV2lDPo8J5oErnnrdQXEKZUSoiIhH9uuxnL0YOGwIrwJ6n0lcJAfXZyCDw+gkUxiV keQ0cWXXI+KFmP3sMOW6Zi3oi/8wrK06e9pJiQOtjrp+257kIatrp/xZmWKoTQrIuDm6 0nDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=zQQOrgESGDCkEyrIM71xSzHfX8ZEuYbZibrK3lIv7i8=; b=qt8x+fsLSjXxTgq/CL42eRWGDSWCJW7LSAqZO+XzYES2F4sBFuHt1YnQ7/Mv0nsCp9 iO2nxtwSKWxB/j2iG24TcRx1aDOApHb07V41tDRwQ/02w+NprzvbwylnmyLTYFhPs+P1 3YJQMrrjWZCJzprnsIBNHifUSZSN+5duVzSKKzpWORs26JVVyfz3UwgwiVAdEleSYJ5j lWRdBMd1+hLI0b+x4xezOwZXpouya6Konvy8Wxm8bO41yxeXN73IVt12bBOa/74I81d2 cP1F4ADKR39zzkle3TdA6NMum86r6I1eAfhH/k/c+R0vVzAF9bywDySTyQq2ajz3z1mE 6llw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=F9QaUd7n; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h66si8338990pgc.418.2019.04.10.06.48.22; Wed, 10 Apr 2019 06:48:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=F9QaUd7n; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731291AbfDJNrj (ORCPT + 99 others); Wed, 10 Apr 2019 09:47:39 -0400 Received: from mail-ua1-f68.google.com ([209.85.222.68]:35853 "EHLO mail-ua1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728787AbfDJNrj (ORCPT ); Wed, 10 Apr 2019 09:47:39 -0400 Received: by mail-ua1-f68.google.com with SMTP id k32so791958uae.3 for ; Wed, 10 Apr 2019 06:47:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=zQQOrgESGDCkEyrIM71xSzHfX8ZEuYbZibrK3lIv7i8=; b=F9QaUd7neKHbxseTkVzKegwJs/tU/hugwDn1aiLgnXVphYCY+GceIM4ZyYNceOouUs 5Gmaz/0gRqFKLhDS4Ev0TEinnFid9qVy44F9flqMTliwsnaQeVuvIGFoDeGvvfG3C4P2 zexc4jy6oQU3UWkgEwfg9/pNKw4fdtsnoYMtqpIymusA6FHd/q12inlwsVDb6RGBZfIL caF0O93WMNDKZqoAUe/Q5JZvP5OPUGjiZaqOlI/FtJA4qbHZg5BRrY+5MVt0iLDiPTp7 5LmfruLcknIkWjWRw4BrR6Erx62ECjL+uVCQGeR4GChxI6Uua3eDzFWMWM8kUzksra71 SrAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=zQQOrgESGDCkEyrIM71xSzHfX8ZEuYbZibrK3lIv7i8=; b=SGphcnrp6rHkN5K7b9wwFKN4C/Z2s8VpPIg8cFaqaYzDg3Xet1weu+gCYL410oywbh IAL/k5CylJNuSG0WnW8FCp3NQ+3wwaTM0du+grjwrfWpkTYq9ixw/ZCKMXp9Pt1fEZK8 iEndZOF88ylESNJkybYB3TAgx4w85atPPJNzPLcRFZ45spuhSdBVwjHdfmtMLzTvhvBJ wuUM5Usb2ZKl7zPUPlfhDIQWy9NIsMPaPLQg3INR2vsA7tofti98wIO4FFAuwWLdczyu ZqOdvS+Srn68QEqn3JkPQpk7ySTQj/YIiZgYzqZyghJ7ta5KoYTDXJlWahRLyfWHIYSW PT4g== X-Gm-Message-State: APjAAAU1baHLPg5YWlJk0tEjBKNZUO6NMjfhyLRnLNbexxlj8sWc7tRt y/4twpQq4brHqU3C/BGNOWP2UPnylOZatzIJL30SNeHkHz8= X-Received: by 2002:ab0:1d82:: with SMTP id l2mr23247938uak.120.1554904058043; Wed, 10 Apr 2019 06:47:38 -0700 (PDT) MIME-Version: 1.0 References: <20190410102754.387743324@linutronix.de> <20190410103646.221275815@linutronix.de> In-Reply-To: <20190410103646.221275815@linutronix.de> From: Alexander Potapenko Date: Wed, 10 Apr 2019 15:47:26 +0200 Message-ID: Subject: Re: [RFC patch 29/41] btrfs: ref-verify: Simplify stack trace retrieval To: Thomas Gleixner Cc: LKML , Josh Poimboeuf , x86@kernel.org, Andy Lutomirski , Steven Rostedt , Alexander Potapenko , David Sterba , Chris Mason , Josef Bacik , linux-btrfs@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 10, 2019 at 1:06 PM Thomas Gleixner wrote: > > Replace the indirection through struct stack_trace with an invocation of > the storage array based interface. > > Signed-off-by: Thomas Gleixner > Cc: David Sterba > Cc: Chris Mason > Cc: Josef Bacik > Cc: linux-btrfs@vger.kernel.org > --- > fs/btrfs/ref-verify.c | 15 ++------------- > 1 file changed, 2 insertions(+), 13 deletions(-) > > --- a/fs/btrfs/ref-verify.c > +++ b/fs/btrfs/ref-verify.c > @@ -205,28 +205,17 @@ static struct root_entry *lookup_root_en > #ifdef CONFIG_STACKTRACE > static void __save_stack_trace(struct ref_action *ra) > { > - struct stack_trace stack_trace; > - > - stack_trace.max_entries =3D MAX_TRACE; > - stack_trace.nr_entries =3D 0; > - stack_trace.entries =3D ra->trace; > - stack_trace.skip =3D 2; > - save_stack_trace(&stack_trace); > - ra->trace_len =3D stack_trace.nr_entries; > + ra->trace_len =3D stack_trace_save(ra->trace, MAX_TRACE, 2); Now that stack_trace.skip is gone, it's unclear what this "2" stands for. Maybe add an inline comment saying it's skipnr? (This is probably valid for all other stack_trace_save() callsites) > } > > static void __print_stack_trace(struct btrfs_fs_info *fs_info, > struct ref_action *ra) > { > - struct stack_trace trace; > - > if (ra->trace_len =3D=3D 0) { > btrfs_err(fs_info, " ref-verify: no stacktrace"); > return; > } > - trace.nr_entries =3D ra->trace_len; > - trace.entries =3D ra->trace; > - print_stack_trace(&trace, 2); > + stack_trace_print(ra->trace, ra->trace_len, 2); > } > #else > static void inline __save_stack_trace(struct ref_action *ra) > > --=20 Alexander Potapenko Software Engineer Google Germany GmbH Erika-Mann-Stra=C3=9Fe, 33 80636 M=C3=BCnchen Gesch=C3=A4ftsf=C3=BChrer: Paul Manicle, Halimah DeLaine Prado Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg