From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-xe42.google.com ([2607:f8b0:4864:20::e42]) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91) (envelope-from ) id 1gO0Is-0000Z3-US for kernelnewbies@kernelnewbies.org; Sat, 17 Nov 2018 08:06:27 -0500 Received: by mail-vs1-xe42.google.com with SMTP id x64so15327498vsa.5 for ; Sat, 17 Nov 2018 05:06:26 -0800 (PST) MIME-Version: 1.0 References: <28496.1542300549@turing-police.cc.vt.edu> <49219.1542367988@turing-police.cc.vt.edu> <5997.1542386778@turing-police.cc.vt.edu> <15703.1542393111@turing-police.cc.vt.edu> In-Reply-To: <15703.1542393111@turing-police.cc.vt.edu> From: Pintu Agarwal Date: Sat, 17 Nov 2018 18:36:12 +0530 Message-ID: Subject: Re: [ARM64] Printing IRQ stack usage information To: Valdis Kletnieks Cc: mark.rutland@arm.com, Jungseok Lee , kernelnewbies@kernelnewbies.org, catalin.marinas@arm.com, Sungjinn Chung , will.deacon@arm.com, open list , Russell King - ARM Linux , Takahiro Akashi , linux-arm-kernel@lists.infradead.org List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org Message-ID: <20181117130612.YSiVn8UVxZ0yS_uVx5iSmGQmBZ-cjTU51zmuNNOZAtk@z> On Sat, Nov 17, 2018 at 12:02 AM wrote: > > On Fri, 16 Nov 2018 23:13:48 +0530, Pintu Agarwal said: > > On Fri, Nov 16, 2018 at 10:16 PM wrote: > > > > Congrats. You just re-invented DEBUG_STACK_USAGE, which just keeps a high-water mark > > > for stack usage. > > > > So, you mean to say, my implementation is good enough to get the > > irq_stack usage, from the interrupt handler ? > > No - your code doesn't keep a high-water mark (which should probably be > hooked into the IRQ exit code. > > > But my concern is that if I dump it from irq handler, I will get > > information only for the current cpu. > > How do I store and get the information for all the cpu from the boot time ? > > Make the high-water mark a per-cpu variable. > > > From where do I call my dump_irq_stack_info() [some where during the > > entry/exit part of the irq handler], so that I could dump information > > for all the handler at boot time itself ? > > No, you don't do a dump-stack during entry/exit. You just maintain a high-water > value in the exit, Which is the right place to keep track of this high-water-irq-stack-usage (per_cpu) in arch/arm64/* ? > and then you create a /proc/something or similar that when > read does a 'foreach CPU do print_high_water_irq'. > Ok got it. > > Like I would to capture these information: > > - What was the name of the handler ? > > - Which cpu was executing it ? > > - How much irq stack (max value, same like high water mark) were used > > at that time ? > > First, do the easy part and find out if you even *care* once you see actual > numbers. If your IRQ stack is 8K but you never use more than 2500 bytes, > do you *really* care about the name of the handler anymore? > Hmm, yes, getting the name of the handler is not so important in the first run. > Also, see the code for /proc/interrupts to see how it keeps track of the > interrupts per CPU - maybe all you need to do is change each entry from > a 'count' to 'count, highwater'. Ok thanks, thats a good pointer. _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies