linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v2 00/19] dynamic debug diet plan
@ 2020-12-25 20:19 Jim Cromie
  2020-12-25 20:19 ` [RFC PATCH v2 01/19] dyndbg: fix use before null check Jim Cromie
                   ` (19 more replies)
  0 siblings, 20 replies; 23+ messages in thread
From: Jim Cromie @ 2020-12-25 20:19 UTC (permalink / raw)
  To: jbaron, gregkh, linux-kernel; +Cc: Jim Cromie

Well, we're mostly overeating, but we can all look forward to a diet
in January.  And more exersize.

dyndbg's compiled-in data-table currently uses 56 bytes per prdebug;
this includes 3 pointers to hierarchical "decorator" data, which is
primarily for adding "module:function:line:" prefixes to prdebug
messages, and for enabling and modifying those prdebugs selectively.

This patchset decouples "decorator" data, and makes it optional, and
disposable.  By separating that data, it opens up possiblities to
compress it, swap it out, map it selectively, etc.


In more detail, patchset does:

1- split struct _ddebug in 2, move "decorator" fields to _ddebug_callsites.

while this adds a pointer per site to memory footprint, it allows:

a- dropping decorations and storage, for some use cases.
   this could include DRM:
   - want to save calls to drm_debug_enabled()
   - use distinct categories, can map to format-prefixes, ex: "drm:kms:"
   - don't need "module:function:line" dynamic prefixes.
   - dont mind loss of info/context in /proc/dynamic_debug/control

b- ddebug_callsites[] contents are hierarchical, compressible.
c- ddebug_callsites[] in separate section is compressible as a block.
d- for just enabled prdebugs, could allocate callsites and fill from zblock.

2- make ddebug_callsites optional internally.
   This lets us drop them outright, for any reason, perhaps memory pressure.

3- allow dropping callsites by those users.
   echo module drm +D > /proc/dynamic_debug/control
   this doesnt currently recover __dyndbg_callsites storage

4- drop _ddebug.site, convert to _ddebug[N].property<x> lookup.
   RFC is mostly here.

rev1: https://lore.kernel.org/lkml/20201125194855.2267337-1-jim.cromie@gmail.com/

rev2 differs by dropping zram attempt, making callsite data optional, etc.


Jim Cromie (19): against v5.10

  dyndbg: fix use before null check
1 dyndbg: split struct _ddebug, move display fields to new
    _ddebug_callsite
    
2 dyndbg: refactor part of ddebug_change to ddebug_match_site
  dyndbg: accept null site in ddebug_match_site
  dyndbg: hoist ->site out of ddebug_match_site
  dyndbg: accept null site in ddebug_change
  dyndbg: accept null site in dynamic_emit_prefix
  dyndbg: accept null site in ddebug_proc_show
  
  dyndbg: optimize ddebug_emit_prefix
  dyndbg: avoid calling dyndbg_emit_prefix when it has no work
  
3 dyndbg: refactor ddebug_alter_site out of ddebug_change
  dyndbg: allow deleting site info via control interface
  
4 dyndbg: verify __dyndbg & __dyndbg_callsite invariant
  dyndbg+module: expose dyndbg_callsites to modules
  dyndbg: add ddebug_site_get/put api with pass-thru impl
  dyndbg: ddebug_site_get/put api commentary
  dyndbg: rearrange struct ddebug_callsites
  dyndbg: add module_index to struct _ddebug
  dyndbg: try DEFINE_DYNAMIC_DEBUG_TABLE

 drivers/gpu/drm/i915/i915_drv.c   |   3 +
 include/asm-generic/vmlinux.lds.h |   4 +
 include/linux/dynamic_debug.h     |  97 ++++++++---
 kernel/module-internal.h          |   1 +
 kernel/module.c                   |   9 +-
 lib/dynamic_debug.c               | 271 +++++++++++++++++++++---------
 6 files changed, 283 insertions(+), 102 deletions(-)

-- 
2.29.2


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2021-01-06 17:51 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-25 20:19 [RFC PATCH v2 00/19] dynamic debug diet plan Jim Cromie
2020-12-25 20:19 ` [RFC PATCH v2 01/19] dyndbg: fix use before null check Jim Cromie
2020-12-25 20:19 ` [RFC PATCH v2 02/19] dyndbg: split struct _ddebug, move display fields to new _ddebug_callsite Jim Cromie
2020-12-31  2:34   ` [dyndbg] e83b4a5011: leaking-addresses.proc.__dyndbg_callsites kernel test robot
2020-12-25 20:19 ` [RFC PATCH v2 03/19] dyndbg: refactor part of ddebug_change to ddebug_match_site Jim Cromie
2020-12-25 20:19 ` [RFC PATCH v2 04/19] dyndbg: accept null site in ddebug_match_site Jim Cromie
2020-12-25 20:19 ` [RFC PATCH v2 05/19] dyndbg: hoist ->site out of ddebug_match_site Jim Cromie
2020-12-25 20:19 ` [RFC PATCH v2 06/19] dyndbg: accept null site in ddebug_change Jim Cromie
2020-12-25 20:19 ` [RFC PATCH v2 07/19] dyndbg: accept null site in dynamic_emit_prefix Jim Cromie
2020-12-25 20:19 ` [RFC PATCH v2 08/19] dyndbg: accept null site in ddebug_proc_show Jim Cromie
2020-12-25 20:19 ` [RFC PATCH v2 09/19] dyndbg: optimize ddebug_emit_prefix Jim Cromie
2020-12-25 20:19 ` [RFC PATCH v2 10/19] dyndbg: avoid calling dyndbg_emit_prefix when it has no work Jim Cromie
2020-12-25 20:19 ` [RFC PATCH v2 11/19] dyndbg: refactor ddebug_alter_site out of ddebug_change Jim Cromie
2020-12-25 20:19 ` [RFC PATCH v2 12/19] dyndbg: allow deleting site info via control interface Jim Cromie
2020-12-25 20:19 ` [RFC PATCH v2 13/19] dyndbg: verify __dyndbg & __dyndbg_callsite invariant Jim Cromie
2020-12-25 20:19 ` [RFC PATCH v2 14/19] dyndbg+module: expose ddebug_callsites to modules Jim Cromie
2020-12-25 20:19 ` [RFC PATCH v2 15/19] dyndbg: add ddebug_site_get/put api with pass-thru impl Jim Cromie
2020-12-25 20:19 ` [RFC PATCH v2 16/19] dyndbg: ddebug_site_get/put api commentary Jim Cromie
2020-12-25 20:19 ` [RFC PATCH v2 17/19] dyndbg: rearrange struct ddebug_callsites Jim Cromie
2020-12-25 20:19 ` [RFC PATCH v2 18/19] dyndbg: add module_index to struct _ddebug Jim Cromie
2020-12-25 20:19 ` [RFC PATCH v2 19/19] dyndbg: try DEFINE_DYNAMIC_DEBUG_TABLE Jim Cromie
2020-12-29 18:56 ` [RFC PATCH v2 00/19] dynamic debug diet plan Joe Perches
2021-01-06 17:50   ` jim.cromie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).