All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jarkko Sakkinen" <jarkko@kernel.org>
To: "Jarkko Sakkinen" <jarkko@kernel.org>, <linux-riscv@lists.infradead.org>
Cc: "Paul Walmsley" <paul.walmsley@sifive.com>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Albert Ou" <aou@eecs.berkeley.edu>,
	<linux-kernel@vger.kernel.org>,
	"Naveen N . Rao" <naveen.n.rao@linux.ibm.com>,
	"Anil S Keshavamurthy" <anil.s.keshavamurthy@intel.com>,
	"David S . Miller" <davem@davemloft.net>,
	"Masami Hiramatsu" <mhiramat@kernel.org>,
	<linux-trace-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] arch/riscv: Enable kprobes when CONFIG_MODULES=n
Date: Sun, 24 Mar 2024 01:31:23 +0200	[thread overview]
Message-ID: <D01IRZK3V45H.3594SKXE83TN9@kernel.org> (raw)
In-Reply-To: <20240323232908.13261-1-jarkko@kernel.org>

On Sun Mar 24, 2024 at 1:29 AM EET, Jarkko Sakkinen wrote:
> Tracing with kprobes while running a monolithic kernel is currently
> impossible due the kernel module allocator dependency.
>
> Address the issue by allowing architectures to implement module_alloc()
> and module_memfree() independent of the module subsystem. An arch tree
> can signal this by setting HAVE_KPROBES_ALLOC in its Kconfig file.
>
> Realize the feature on RISC-V by separating allocator to module_alloc.c
> and implementing module_memfree().
>
> Link: https://www.sochub.fi # for power on testing new SoC's with a minimal stack
> Link: https://lore.kernel.org/all/20220608000014.3054333-1-jarkko@profian.com/ # continuation
> Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>

As for testing I tried the kprobes example for boottime tracing
dcoumentation:

https://www.kernel.org/doc/html/v5.7/trace/boottime-trace.html

I.e.

ftrace.event {
	kprobes.vfs_read {
		probes = "vfs_read $arg1 $arg2"
		filter = "common_pid < 100"
		enable
	}
}

kernel {
	console = hvc0
	earlycon = sbi
	trace_options = sym-addr
	trace_event = "initcall:*"
	tp_printk
	dump_on_oops = 2
	trace_buf_size = 1M
}

BR, Jarkko

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

WARNING: multiple messages have this Message-ID (diff)
From: "Jarkko Sakkinen" <jarkko@kernel.org>
To: "Jarkko Sakkinen" <jarkko@kernel.org>, <linux-riscv@lists.infradead.org>
Cc: "Paul Walmsley" <paul.walmsley@sifive.com>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Albert Ou" <aou@eecs.berkeley.edu>,
	<linux-kernel@vger.kernel.org>,
	"Naveen N . Rao" <naveen.n.rao@linux.ibm.com>,
	"Anil S Keshavamurthy" <anil.s.keshavamurthy@intel.com>,
	"David S . Miller" <davem@davemloft.net>,
	"Masami Hiramatsu" <mhiramat@kernel.org>,
	<linux-trace-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] arch/riscv: Enable kprobes when CONFIG_MODULES=n
Date: Sun, 24 Mar 2024 01:31:23 +0200	[thread overview]
Message-ID: <D01IRZK3V45H.3594SKXE83TN9@kernel.org> (raw)
In-Reply-To: <20240323232908.13261-1-jarkko@kernel.org>

On Sun Mar 24, 2024 at 1:29 AM EET, Jarkko Sakkinen wrote:
> Tracing with kprobes while running a monolithic kernel is currently
> impossible due the kernel module allocator dependency.
>
> Address the issue by allowing architectures to implement module_alloc()
> and module_memfree() independent of the module subsystem. An arch tree
> can signal this by setting HAVE_KPROBES_ALLOC in its Kconfig file.
>
> Realize the feature on RISC-V by separating allocator to module_alloc.c
> and implementing module_memfree().
>
> Link: https://www.sochub.fi # for power on testing new SoC's with a minimal stack
> Link: https://lore.kernel.org/all/20220608000014.3054333-1-jarkko@profian.com/ # continuation
> Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>

As for testing I tried the kprobes example for boottime tracing
dcoumentation:

https://www.kernel.org/doc/html/v5.7/trace/boottime-trace.html

I.e.

ftrace.event {
	kprobes.vfs_read {
		probes = "vfs_read $arg1 $arg2"
		filter = "common_pid < 100"
		enable
	}
}

kernel {
	console = hvc0
	earlycon = sbi
	trace_options = sym-addr
	trace_event = "initcall:*"
	tp_printk
	dump_on_oops = 2
	trace_buf_size = 1M
}

BR, Jarkko

  reply	other threads:[~2024-03-23 23:31 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-23 23:29 [PATCH v2] arch/riscv: Enable kprobes when CONFIG_MODULES=n Jarkko Sakkinen
2024-03-23 23:29 ` Jarkko Sakkinen
2024-03-23 23:31 ` Jarkko Sakkinen [this message]
2024-03-23 23:31   ` Jarkko Sakkinen
2024-03-24  0:37 ` Randy Dunlap
2024-03-24  0:37   ` Randy Dunlap
2024-03-24  2:09   ` Jarkko Sakkinen
2024-03-24  2:09     ` Jarkko Sakkinen
2024-03-25  2:56 ` Masami Hiramatsu
2024-03-25  2:56   ` Masami Hiramatsu
2024-03-25  3:58   ` Calvin Owens
2024-03-25  3:58     ` Calvin Owens
2024-03-25 18:37   ` Jarkko Sakkinen
2024-03-25 18:37     ` Jarkko Sakkinen
2024-03-25 19:11     ` Jarkko Sakkinen
2024-03-25 19:11       ` Jarkko Sakkinen
2024-03-25 19:16       ` Jarkko Sakkinen
2024-03-25 19:16         ` Jarkko Sakkinen
2024-03-26 14:46   ` Mark Rutland
2024-03-26 14:46     ` Mark Rutland
2024-03-26 15:24     ` Masami Hiramatsu
2024-03-26 15:24       ` Masami Hiramatsu
2024-03-26 16:15       ` Calvin Owens
2024-03-26 16:15         ` Calvin Owens
2024-03-26 16:45         ` Mark Rutland
2024-03-26 16:45           ` Mark Rutland
2024-03-26 17:09         ` Jarkko Sakkinen
2024-03-26 17:09           ` Jarkko Sakkinen
2024-03-26 16:38       ` Mark Rutland
2024-03-26 16:38         ` Mark Rutland
2024-03-26 17:11         ` Jarkko Sakkinen
2024-03-26 17:11           ` Jarkko Sakkinen
2024-03-26 17:08       ` Jarkko Sakkinen
2024-03-26 17:08         ` Jarkko Sakkinen
2024-03-26 17:00     ` Jarkko Sakkinen
2024-03-26 17:00       ` Jarkko Sakkinen

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=D01IRZK3V45H.3594SKXE83TN9@kernel.org \
    --to=jarkko@kernel.org \
    --cc=anil.s.keshavamurthy@intel.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=naveen.n.rao@linux.ibm.com \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.