|
|
Subscribe / Log in / New account

SFrame based stack tracer for user space in the kernel

From:  Indu Bhagat <indu.bhagat-AT-oracle.com>
To:  linux-toolchains-AT-vger.kernel.org, rostedt-AT-goodmis.org, peterz-AT-infradead.org
Subject:  [POC,V2 0/5] SFrame based stack tracer for user space in the kernel
Date:  Thu, 25 May 2023 22:32:10 -0700
Message-ID:  <20230526053215.3617580-1-indu.bhagat@oracle.com>
Cc:  Indu Bhagat <indu.bhagat-AT-oracle.com>
Archive-link:  Article

Hello,

I have addressed the code review comments and hopefully made the SFrame
reader code more maintainable.

Link to V1 posting: https://lore.kernel.org/linux-toolchains/20230501181515.0...

The POC still suffers with the same issue: accessing SFrame data is not NMI
safe.  This is expected to be addressed via the changes to perf workings
proposed by Steve.

Once it is clearer what sort of callback APIs are required for the kernel to
gather user space stack trace using SFrame stack tracer, I am happy to work on
that later and make the necessary changes to SFrame stack tracer code in
lib/sframe/sframe_unwind.c and lib/sframe/sframe_state.c etc.

As some of the code in lib/sframe/iterate_phdr.[ch] will get dropped or
reworked, I skipped spending time on improving those files ATM.

Thanks,

Indu Bhagat (5):
  Kconfig: x86: Add new config options for userspace unwinder
  task_struct : add additional member for sframe state
  sframe: add new SFrame library
  sframe: add an SFrame format stack tracer
  x86_64: invoke SFrame based stack tracer for user space

 arch/x86/Kconfig.debug        |  31 ++
 arch/x86/events/core.c        |  51 ++++
 fs/binfmt_elf.c               |  37 +++
 include/linux/sched.h         |   5 +
 include/linux/sframe_unwind.h |  72 +++++
 kernel/exit.c                 |   9 +
 lib/Makefile                  |   1 +
 lib/sframe/Makefile           |  11 +
 lib/sframe/iterate_phdr.c     | 115 +++++++
 lib/sframe/iterate_phdr.h     |  39 +++
 lib/sframe/sframe.h           | 264 ++++++++++++++++
 lib/sframe/sframe_read.c      | 549 ++++++++++++++++++++++++++++++++++
 lib/sframe/sframe_read.h      |  80 +++++
 lib/sframe/sframe_state.c     | 447 +++++++++++++++++++++++++++
 lib/sframe/sframe_state.h     |  84 ++++++
 lib/sframe/sframe_unwind.c    | 214 +++++++++++++
 16 files changed, 2009 insertions(+)
 create mode 100644 include/linux/sframe_unwind.h
 create mode 100644 lib/sframe/Makefile
 create mode 100644 lib/sframe/iterate_phdr.c
 create mode 100644 lib/sframe/iterate_phdr.h
 create mode 100644 lib/sframe/sframe.h
 create mode 100644 lib/sframe/sframe_read.c
 create mode 100644 lib/sframe/sframe_read.h
 create mode 100644 lib/sframe/sframe_state.c
 create mode 100644 lib/sframe/sframe_state.h
 create mode 100644 lib/sframe/sframe_unwind.c

-- 
2.39.2



Copyright © 2023, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds