From: imran.f.khan@oracle.com
To: Vlastimil Babka <vbabka@suse.cz>,
geert@linux-m68k.org, akpm@linux-foundation.org,
ryabinin.a.a@gmail.com, glider@google.com, andreyknvl@gmail.com,
dvyukov@google.com
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH v2 2/2] lib, stackdepot: Add helper to print stack entries.
Date: Wed, 15 Sep 2021 13:29:38 +1000 [thread overview]
Message-ID: <8ecc3437-8895-c12a-ecaf-f9625fa3e364@oracle.com> (raw)
In-Reply-To: <ef0aa660-0cb6-dc21-f2ce-368b34f8af3d@suse.cz>
On 14/9/21 7:01 pm, Vlastimil Babka wrote:
> On 9/2/21 02:01, Imran Khan wrote:
>> To print a stack entries, users of stackdepot, first
>> use stack_depot_fetch to get a list of stack entries
>> and then use stack_trace_print to print this list.
>> Provide a helper in stackdepot to print stack entries
>> based on stackdepot handle.
>> Also change above mentioned users to use this helper.
>>
[...]
>>
>> +/**
>> + * stack_depot_print - print stack entries from a depot
>> + *
>> + * @handle: Stack depot handle which was returned from
>> + * stack_depot_save().
>> + *
>> + */
>> +void stack_depot_print(depot_stack_handle_t stack)
>> +{
>> + unsigned long *entries;
>> + unsigned int nr_entries;
>> +
>> + nr_entries = stack_depot_fetch(stack, &entries);
>
> Maybe this should also skip stack_trace_print when nr_entries is 0, to avoid
> the warning. While the callers added by this patch check handle != 0, future
> ones might not.
>
Agree. I have incorporated this suggestion in latest version [1]
[1]
https://lore.kernel.org/lkml/20210915014806.3206938-1-imran.f.khan@oracle.com/
Thanks
-- Imran
prev parent reply other threads:[~2021-09-15 3:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-02 0:01 [RFC PATCH v2 0/2] lib, stackdepot: check stackdepot handle before accessing slabs Imran Khan
2021-09-02 0:01 ` [RFC PATCH v2 1/2] " Imran Khan
2021-09-02 7:53 ` Vlastimil Babka
2021-09-02 0:01 ` [RFC PATCH v2 2/2] lib, stackdepot: Add helper to print stack entries Imran Khan
2021-09-02 7:55 ` Vlastimil Babka
2021-09-03 16:03 ` Alexander Potapenko
2021-09-14 9:01 ` Vlastimil Babka
2021-09-15 3:29 ` imran.f.khan [this message]
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=8ecc3437-8895-c12a-ecaf-f9625fa3e364@oracle.com \
--to=imran.f.khan@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=andreyknvl@gmail.com \
--cc=dvyukov@google.com \
--cc=geert@linux-m68k.org \
--cc=glider@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ryabinin.a.a@gmail.com \
--cc=vbabka@suse.cz \
/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