From: "Alexis Lothoré" <alexis.lothore@bootlin.com>
To: "Ihor Solodrai" <ihor.solodrai@linux.dev>, <dwarves@vger.kernel.org>
Cc: "Alan Maguire" <alan.maguire@oracle.com>,
"Arnaldo Carvalho de Melo" <acme@redhat.com>,
<ebpf@linuxfoundation.org>,
"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
"Bastien Curutchet" <bastien.curutchet@bootlin.com>
Subject: Re: [PATCH] pahole: do not return an error when printing only a specific class
Date: Wed, 23 Jul 2025 10:39:21 +0200 [thread overview]
Message-ID: <DBJASAZ3SGNN.364AZ1P0QK6G6@bootlin.com> (raw)
In-Reply-To: <e1afba7b-93f9-4ed3-9cd5-ef4ff4bebb70@linux.dev>
Hi Ihor,
On Wed Jul 23, 2025 at 1:42 AM CEST, Ihor Solodrai wrote:
> On 7/16/25 2:04 AM, Alexis Lothoré (eBPF Foundation) wrote:
[...]
>> cu__finalize(cu, cus, conf);
>> - if (cus__steal_now(cus, cu, conf) == LSK__STOP_LOADING)
>> + if (cus__steal_now(cus, cu, conf) == LSK__ABORT)
>> goto out_abort;
>
> I think we should handle both LSK__STOP_LOADING and LSK__ABORT here,
> otherwise the worker will keep loading DWARF (which is most of the
> pahole's work) and passing cu-s to the stealer function.
>
> I guess in many cases it'll complete without errors, but it's just
> unnecessary work.
>
> Maybe add a check for LSK__STOP_LOADING here with goto_ok?
Hmmm, I am not sure how to follow you here. Even if cus__steal_now returns
LSK__STOP_LOADING, I need to return DWARF_CB_OK from
cus__merge_and_process_cu, otherwise it will be processed as an error
again. Or are you suggesting just make sure to delete current cu but still
return DWARF_CB_OK when getting LSK__STOP_LOADING, as done below ?
--- a/dwarf_loader.c
+++ b/dwarf_loader.c
@@ -3796,6 +3796,7 @@ static int cus__merge_and_process_cu(struct cus *cus, struct conf_load *conf,
Dwarf_Off off = 0, noff;
struct cu *cu = NULL;
size_t cuhl;
+ int res;
while (dwarf_nextcu(dw, off, &noff, &cuhl, NULL, &pointer_size,
&offset_size) == 0) {
@@ -3874,7 +3875,8 @@ static int cus__merge_and_process_cu(struct cus *cus, struct conf_load *conf,
goto out_abort;
cu__finalize(cu, cus, conf);
- if (cus__steal_now(cus, cu, conf) == LSK__ABORT)
+ res = cus__steal_now(cus, cu, conf);
+ if (res == LSK__STOP_LOADING || res == LSK__ABORT)
goto out_abort;
return 0;
@@ -3882,7 +3884,7 @@ static int cus__merge_and_process_cu(struct cus *cus, struct conf_load *conf,
out_abort:
dwarf_cu__delete(cu);
cu__delete(cu);
- return DWARF_CB_ABORT;
+ return res == LSK__STOP_LOADING ? DWARF_CB_OK : DWARF_CB_ABORT;
}
Thanks,
Alexis
--
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2025-07-23 8:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-16 9:04 [PATCH] pahole: do not return an error when printing only a specific class Alexis Lothoré (eBPF Foundation)
2025-07-22 23:42 ` Ihor Solodrai
2025-07-23 8:39 ` Alexis Lothoré [this message]
2025-07-23 10:03 ` Alan Maguire
2025-07-23 15:37 ` Ihor Solodrai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DBJASAZ3SGNN.364AZ1P0QK6G6@bootlin.com \
--to=alexis.lothore@bootlin.com \
--cc=acme@redhat.com \
--cc=alan.maguire@oracle.com \
--cc=bastien.curutchet@bootlin.com \
--cc=dwarves@vger.kernel.org \
--cc=ebpf@linuxfoundation.org \
--cc=ihor.solodrai@linux.dev \
--cc=thomas.petazzoni@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox