Message ID | 20221219135303.116222-1-mpapini@redhat.com |
---|---|
Headers |
Return-Path: <binutils-bounces+ouuuleilei=gmail.com@sourceware.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp2399291wrn; Mon, 19 Dec 2022 05:53:56 -0800 (PST) X-Google-Smtp-Source: AMrXdXu9FG3zgStvBMovkAtoAibCl6wvdx5GZQvnASxvAcvyUPcdVRfRcwbGl9UQ3tDWGtfz9Y2X X-Received: by 2002:a17:906:b312:b0:815:8942:dde with SMTP id n18-20020a170906b31200b0081589420ddemr6683611ejz.23.1671458036066; Mon, 19 Dec 2022 05:53:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671458036; cv=none; d=google.com; s=arc-20160816; b=COhBStNSWttQEC1/ZGeKLbUFfPao7/s5ywuci9mjgWIBUzx5ASZE8USFvW2fBnuaGr ezD2jRTkbyQltoczoHNnDuLDTXFE0i31XcfU+9xNC/azK9Vyem84mPbkXuJy5LO8wdFh FJvesL/fOvn69Wl78NrvxlfPD5NHbIKTVY9DDcpUzfEjUh6i9zgUeL8KAiV//znTW1Ai GKMFC7zLuumis5qIfiBVk+LiQxKayk8g+4bCi5zUhKaqyRHgBuUQbc8BAAi/0WI6wZKp 4PJ56RphgWE5FSq35JhSuxANxgshCy7LJFyfMU5cwIUVbULV2lb8WCzmz6jpGSPSzO/x radA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=x8mSJlJGB87ufKXdRc8W4qGCnnquFz5xBv7Wc0KsXco=; b=HLOTdOipQACcX0D/lGq+C79s1P+jONcWjSHZaYuLxWKLMYm+A33E32eVNOyClbzNGl cXkjKUNm0KuRsJXgbsC0Ea8Ju1GSLplPwUDusOX9Ysc7xpTd8NovqjUaqUpp3zsTRaDm jXw5kf8YU6uufwxI5rs+jMV4d5Lc4pR3yNsVAgshnrGNWWCIh79NnPBC9bO8yc29vzov VOe1aJ4amxfF1qp+v4SpXP26jiKbJUWhl37XA3CaDXn/+EGFcpCNkFnGN9keCSJ3C7rX iZ1+fX/4wyuERFO2M9mRprxXZJ3JtlR37WNL9KHmr/5088K+ujZp/00mSdkxP2iYjHOy Rb2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=rcJhZRgF; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id hp23-20020a1709073e1700b007c0c2ec3683si9716702ejc.106.2022.12.19.05.53.55 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 05:53:56 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=rcJhZRgF; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 111FA3858D1E for <ouuuleilei@gmail.com>; Mon, 19 Dec 2022 13:53:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 111FA3858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1671458035; bh=x8mSJlJGB87ufKXdRc8W4qGCnnquFz5xBv7Wc0KsXco=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=rcJhZRgFdVe4DzwCryXuaOQB9kcdEALFgztFmR2UwwWt6fWGD5uAjeIuHbWQ/7QVd fjZUjXUAL+M+aBS9Q3lEaxLGTCN4UmGCCH3s/Y3ikwMtVVou1Z+O8hePKMNzTA0VD0 XjA+XUPeVLjQvpXECxlEbBcjRifeoV7PhUdqF6Mw= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 5EF183858C83 for <binutils@sourceware.org>; Mon, 19 Dec 2022 13:53:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5EF183858C83 Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-83-ljLu4moDPmGLSfn2Hzc1OQ-1; Mon, 19 Dec 2022 08:53:45 -0500 X-MC-Unique: ljLu4moDPmGLSfn2Hzc1OQ-1 Received: by mail-ed1-f72.google.com with SMTP id w15-20020a05640234cf00b0046d32d7b153so6537547edc.0 for <binutils@sourceware.org>; Mon, 19 Dec 2022 05:53:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=x8mSJlJGB87ufKXdRc8W4qGCnnquFz5xBv7Wc0KsXco=; b=hxf5KAgr0z6GwRY2/sVjBmw09vnMHVTquPa/rUmR5gJsHmI0pLYjaClQ2QuhfFZrs5 JDDSySnF6KoWtl7x9a7haVFXbGbFccj1aCOg1PfIjWJ9l6NhLQ1xMKxCF4vedfReyeKz afxl9QTTR93eOURTqfLGooIdkjKOnvhZC3zRl+wo4OwN0TnUQbguzuGd6mMTMqYU82TY t+uoAf0mHCzqjSKkRHsujH9QtB2YIkcEnE8SJ6Eow2xkJf7jtVNb6H4sQA524WSUu1zU 5mH2yu3C+6nqEJDMMbAUjQ7XeZ2mkRkGHMa7HdyjdkWgp4t/jXTO+rBzco7zVPzsafqK rqBg== X-Gm-Message-State: ANoB5plm10jHFNA1SqEtkfXJ07o4hIF4vsn914YS7FhTYPFmCHUknQi9 JpFR8gXIgKuJ9iQIY2/JuYJCheteW91TrrBP87XWQfDrtakXIGViaoFBxHMGO/UCZE1dLgpPMkR 9qydzEcrmaruId6aZ0xArP1RNVa4hKZ9G9Ux6wpt2F4ypgfbZccuOShFkbZVWrFs2of40 X-Received: by 2002:a17:906:bce4:b0:7c0:c36d:f5df with SMTP id op4-20020a170906bce400b007c0c36df5dfmr54596226ejb.70.1671458024179; Mon, 19 Dec 2022 05:53:44 -0800 (PST) X-Received: by 2002:a17:906:bce4:b0:7c0:c36d:f5df with SMTP id op4-20020a170906bce400b007c0c36df5dfmr54596209ejb.70.1671458023947; Mon, 19 Dec 2022 05:53:43 -0800 (PST) Received: from ulissedini.. ([81.56.11.23]) by smtp.gmail.com with ESMTPSA id t21-20020a056402021500b00463bc1ddc76sm4377476edv.28.2022.12.19.05.53.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 05:53:43 -0800 (PST) To: binutils@sourceware.org Cc: Maurizio Papini <mpapini@redhat.com> Subject: [PATCH 0/2] addr2line: new option -n to add a newline at the end Date: Mon, 19 Dec 2022 14:53:01 +0100 Message-Id: <20221219135303.116222-1-mpapini@redhat.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list <binutils.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/binutils>, <mailto:binutils-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/binutils/> List-Post: <mailto:binutils@sourceware.org> List-Help: <mailto:binutils-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/binutils>, <mailto:binutils-request@sourceware.org?subject=subscribe> From: Maurizio Papini via Binutils <binutils@sourceware.org> Reply-To: Maurizio Papini <mpapini@redhat.com> Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" <binutils-bounces+ouuuleilei=gmail.com@sourceware.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752650781337057996?= X-GMAIL-MSGID: =?utf-8?q?1752650781337057996?= |
Series |
addr2line: new option -n to add a newline at the end
|
|
Message
Maurizio Papini
Dec. 19, 2022, 1:53 p.m. UTC
This series adds a new option to addr2line (-n) to append a newline after the last informative one. This new option is helpful for using a running addr2line process and performing queries, in particular when the option -i is requested: the additional empty line can be used to mark the end of the inlined functions lists so that an application can get the output without defining a timeout. The first patch adds the new option while the second one adds the relative test. Let me know what you think. Maurizio Maurizio Papini (2): addr2line: new option -n to add a newline at the end addr2line: test to check -n option binutils/addr2line.c | 11 +++++++++-- binutils/doc/binutils.texi | 5 +++++ binutils/testsuite/binutils-all/addr2line.exp | 10 ++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-)
Comments
Hi All, Do you think this should go through an RFC? Do you have any thoughts? Thanks for your time. BR, Maurizio On Mon, Dec 19, 2022 at 2:53 PM Maurizio Papini <mpapini@redhat.com> wrote: > This series adds a new option to addr2line (-n) to append a newline > after the last informative one. > > This new option is helpful for using a running addr2line process and > performing queries, in particular when the option -i is requested: the > additional empty line can be used to mark the end of the inlined functions > lists so that an application can get the output without defining a timeout. > > The first patch adds the new option while the second one adds the relative > test. > > Let me know what you think. > > Maurizio > > > Maurizio Papini (2): > addr2line: new option -n to add a newline at the end > addr2line: test to check -n option > > binutils/addr2line.c | 11 +++++++++-- > binutils/doc/binutils.texi | 5 +++++ > binutils/testsuite/binutils-all/addr2line.exp | 10 ++++++++++ > 3 files changed, 24 insertions(+), 2 deletions(-) > > -- > 2.38.1 > >
On 09.01.2023 17:04, Maurizio Papini via Binutils wrote: > Do you think this should go through an RFC? Do you have any thoughts? Well, I'm of two minds here, which so far kept me from responding: On one hand an option that's useful to someone is probably a good thing. Otoh an option to control a single newline character seems a little too fine grained to me. Plus I'm a little concerned of burning a short option for this (niche?) issue. Since you say it's specifically an issue with -i, would it be an option to add a long-only option providing the intended variant of behavior, i.e. combining what would (aiui) be "-i -n" with the current proposal? Jan > On Mon, Dec 19, 2022 at 2:53 PM Maurizio Papini <mpapini@redhat.com> wrote: > >> This series adds a new option to addr2line (-n) to append a newline >> after the last informative one. >> >> This new option is helpful for using a running addr2line process and >> performing queries, in particular when the option -i is requested: the >> additional empty line can be used to mark the end of the inlined functions >> lists so that an application can get the output without defining a timeout. >> >> The first patch adds the new option while the second one adds the relative >> test. >> >> Let me know what you think. >> >> Maurizio >> >> >> Maurizio Papini (2): >> addr2line: new option -n to add a newline at the end >> addr2line: test to check -n option >> >> binutils/addr2line.c | 11 +++++++++-- >> binutils/doc/binutils.texi | 5 +++++ >> binutils/testsuite/binutils-all/addr2line.exp | 10 ++++++++++ >> 3 files changed, 24 insertions(+), 2 deletions(-) >> >> -- >> 2.38.1 >> >>
Hi Maurizio, > Do you think this should go through an RFC? Do you have any thoughts? I am sorry - I totally missed this patch submission. :-( >> This series adds a new option to addr2line (-n) to append a newline >> after the last informative one. I have to say that I am kind of with Jan on this one - it seems like a lot of effort to fix a small problem. Isn't there an easier way that would not involve patching addr2line ? For example if you use the -a/--addresses option then each decoded address will be prefixed with a line containing a simple hex number. This would allow a consumer of addr2line's output to detect the start of each decoded address. > the > additional empty line can be used to mark the end of the inlined functions > lists so that an application can get the output without defining a timeout. I am not sure what you are getting at here. Are you saying that addr2line can get stuck and so a timeout is needed in order to be to distinguish between addr2line being slow and addr2line being stuck ? If so then this sounds like a more serious problem that needs to be addressed by something other than just adding a blank line to the output. Cheers Nick
Thanks for your feedback Jan. Yes, I understand that one option for a single newline smells fulsome but the idea is to use it to mark the end of output when addr2line is used as a "server" process: right now I see only the "-i" use case, but there could be others in the future for new options. Said that I would propose adding the "add-newline" long option only to trivially add a new line, that could be reused for other output. What do you think? Maurizio On Mon, Jan 9, 2023 at 5:17 PM Jan Beulich <jbeulich@suse.com> wrote: > On 09.01.2023 17:04, Maurizio Papini via Binutils wrote: > > Do you think this should go through an RFC? Do you have any thoughts? > > Well, I'm of two minds here, which so far kept me from responding: On one > hand an option that's useful to someone is probably a good thing. Otoh an > option to control a single newline character seems a little too fine > grained to me. Plus I'm a little concerned of burning a short option for > this (niche?) issue. Since you say it's specifically an issue with -i, > would it be an option to add a long-only option providing the intended > variant of behavior, i.e. combining what would (aiui) be "-i -n" with the > current proposal? > > Jan > > > On Mon, Dec 19, 2022 at 2:53 PM Maurizio Papini <mpapini@redhat.com> > wrote: > > > >> This series adds a new option to addr2line (-n) to append a newline > >> after the last informative one. > >> > >> This new option is helpful for using a running addr2line process and > >> performing queries, in particular when the option -i is requested: the > >> additional empty line can be used to mark the end of the inlined > functions > >> lists so that an application can get the output without defining a > timeout. > >> > >> The first patch adds the new option while the second one adds the > relative > >> test. > >> > >> Let me know what you think. > >> > >> Maurizio > >> > >> > >> Maurizio Papini (2): > >> addr2line: new option -n to add a newline at the end > >> addr2line: test to check -n option > >> > >> binutils/addr2line.c | 11 +++++++++-- > >> binutils/doc/binutils.texi | 5 +++++ > >> binutils/testsuite/binutils-all/addr2line.exp | 10 ++++++++++ > >> 3 files changed, 24 insertions(+), 2 deletions(-) > >> > >> -- > >> 2.38.1 > >> > >> > >
Hi Nick and thanks for your time. > I am sorry - I totally missed this patch submission. :-( The patch is definitely not urgent, trivial stuff indeed, and my submission day was so close to the end of 2022. > I am not sure what you are getting at here. Are you saying that addr2line > can get stuck and so a timeout is needed in order to be to distinguish between > addr2line being slow and addr2line being stuck ? If so then this sounds > like a more serious problem that needs to be addressed by something other > than just adding a blank line to the output. No, I didn't see this kind of problem. I'm talking about this use case: addr2line as a process, with "-i" option, that is reading from stdin working on a big binary, say like the Linux kernel with debug info (~400M+), so that spawning the process once is definitely better than doing it every time. > I have to say that I am kind of with Jan on this one - it seems like > a lot of effort to fix a small problem. Isn't there an easier way > that would not involve patching addr2line ? For example if you use > the -a/--addresses option then each decoded address will be prefixed > with a line containing a simple hex number. This would allow a consumer > of addr2line's output to detect the start of each decoded address. I'm thinking about using your suggestion (thanks): with -a the address is added as a prefix as you said, while it would have been useful to have it at the end :-), but querying two times... Maurizio Maurizio On Tue, Jan 10, 2023 at 1:19 PM Nick Clifton <nickc@redhat.com> wrote: > > Hi Maurizio, > > > Do you think this should go through an RFC? Do you have any thoughts? > > I am sorry - I totally missed this patch submission. :-( > > >> This series adds a new option to addr2line (-n) to append a newline > >> after the last informative one. > > I have to say that I am kind of with Jan on this one - it seems like > a lot of effort to fix a small problem. Isn't there an easier way > that would not involve patching addr2line ? For example if you use > the -a/--addresses option then each decoded address will be prefixed > with a line containing a simple hex number. This would allow a consumer > of addr2line's output to detect the start of each decoded address. > > > > the > > additional empty line can be used to mark the end of the inlined functions > > lists so that an application can get the output without defining a timeout. > > I am not sure what you are getting at here. Are you saying that addr2line > can get stuck and so a timeout is needed in order to be to distinguish between > addr2line being slow and addr2line being stuck ? If so then this sounds > like a more serious problem that needs to be addressed by something other > than just adding a blank line to the output. > > Cheers > Nick > >
On 10.01.2023 15:17, Maurizio Papini wrote: > Thanks for your feedback Jan. > > Yes, I understand that one option for a single newline smells fulsome but > the > idea is to use it to mark the end of output when addr2line is used as a > "server" > process: right now I see only the "-i" use case, but there could be others > in the > future for new options. Said that I would propose adding the "add-newline" > long > option only to trivially add a new line, that could be reused for other > output. > What do you think? I don't really like the idea, but I can see this being a compromise to cover your use case. Yet in your reply to Nick you indicate you might go the route he proposed, which I understand would allow us to get away without any such option. If, however, an option is still needed from your pov, then please make its name more meaningful than just "add-newline" - that doesn't tell at all what the real purpose is. Maybe "separate-<whatever>", with <whatever> suitably replaced, and then possibly also (in the future, not necessarily right now) allowing to specify a character to use as the separator in place of the (default) newline. Jan