Revision tags: v6.6.25, v6.6.24, v6.6.23, v6.6.16, v6.6.15, v6.6.14, v6.6.13, v6.6.12, v6.6.11, v6.6.10, v6.6.9, v6.6.8, v6.6.7, v6.6.6, v6.6.5, v6.6.4, v6.6.3, v6.6.2, v6.5.11, v6.6.1, v6.5.10, v6.6, v6.5.9, v6.5.8, v6.5.7, v6.5.6, v6.5.5, v6.5.4, v6.5.3, v6.5.2, v6.1.51, v6.5.1, v6.1.50, v6.5, v6.1.49, v6.1.48, v6.1.46, v6.1.45, v6.1.44, v6.1.43, v6.1.42, v6.1.41, v6.1.40, v6.1.39, v6.1.38, v6.1.37, v6.1.36, v6.4, v6.1.35, v6.1.34, v6.1.33, v6.1.32, v6.1.31, v6.1.30, v6.1.29, v6.1.28 |
|
#
9e66fb52 |
| 11-May-2023 |
Julien Panis <jpanis@baylibre.com> |
samples: Add userspace example for TI TPS6594 PFSM
This patch adds an example showing how to use PFSM devices from a userspace application. The PMIC is armed to be triggered by a RTC alarm to execut
samples: Add userspace example for TI TPS6594 PFSM
This patch adds an example showing how to use PFSM devices from a userspace application. The PMIC is armed to be triggered by a RTC alarm to execute state transition.
Signed-off-by: Julien Panis <jpanis@baylibre.com> Message-ID: <20230511095126.105104-7-jpanis@baylibre.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
Revision tags: v6.1.27, v6.1.26, v6.3, v6.1.25, v6.1.24, v6.1.23, v6.1.22 |
|
#
27d9a0fd |
| 30-Mar-2023 |
Hao Ge <gehao@kylinos.cn> |
kmemleak-test: fix kmemleak_test.c build logic
kmemleak-test.c was moved to the samples directory in 1abbef4f51724 ("mm,kmemleak-test.c: move kmemleak-test.c to samples dir").
If CONFIG_DEBUG_KMEML
kmemleak-test: fix kmemleak_test.c build logic
kmemleak-test.c was moved to the samples directory in 1abbef4f51724 ("mm,kmemleak-test.c: move kmemleak-test.c to samples dir").
If CONFIG_DEBUG_KMEMLEAK_TEST=m and CONFIG_SAMPLES is unset, kmemleak-test.c will be unnecessarily compiled.
So move the entry for CONFIG_DEBUG_KMEMLEAK_TEST from mm/Kconfig and add a new CONFIG_SAMPLE_KMEMLEAK in samples/ to control whether kmemleak-test.c is built or not.
Link: https://lkml.kernel.org/r/20230330060904.292975-1-gehao@kylinos.cn Fixes: 1abbef4f51724 ("mm,kmemleak-test.c: move kmemleak-test.c to samples dir") Signed-off-by: Hao Ge <gehao@kylinos.cn> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Alex Gaynor <alex.gaynor@gmail.com> Cc: Alex Williamson <alex.williamson@redhat.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Finn Behrens <me@kloenk.dev> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jason Gunthorpe <jgg@ziepe.ca> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Miguel Ojeda <ojeda@kernel.org> Cc: Tony Krowiak <akrowiak@linux.ibm.com> Cc: Ye Xingchen <ye.xingchen@zte.com.cn> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
show more ...
|
Revision tags: v6.1.21, v6.1.20, v6.1.19, v6.1.18, v6.1.17, v6.1.16, v6.1.15, v6.1.14, v6.1.13, v6.2, v6.1.12, v6.1.11, v6.1.10, v6.1.9, v6.1.8, v6.1.7, v6.1.6, v6.1.5, v6.0.19, v6.0.18, v6.1.4, v6.1.3, v6.0.17 |
|
#
b56c68f7 |
| 03-Jan-2023 |
Mark Rutland <mark.rutland@arm.com> |
ftrace: Add sample with custom ops
When reworking core ftrace code or architectural ftrace code, it's often necessary to test/analyse/benchmark a number of ftrace_ops configurations. This patch adds
ftrace: Add sample with custom ops
When reworking core ftrace code or architectural ftrace code, it's often necessary to test/analyse/benchmark a number of ftrace_ops configurations. This patch adds a module which can be used to explore some of those configurations.
I'm using this to benchmark various options for changing the way trampolines and handling of ftrace_ops work on arm64, and ensuring other architectures aren't adversely affected.
For example, in a QEMU+KVM VM running on a 2GHz Xeon E5-2660 workstation, loading the module in various configurations produces:
| # insmod ftrace-ops.ko | ftrace_ops: registering: | relevant ops: 1 | tracee: tracee_relevant [ftrace_ops] | tracer: ops_func_nop [ftrace_ops] | irrelevant ops: 0 | tracee: tracee_irrelevant [ftrace_ops] | tracer: ops_func_nop [ftrace_ops] | saving registers: NO | assist recursion: NO | assist RCU: NO | ftrace_ops: Attempted 100000 calls to tracee_relevant [ftrace_ops] in 1681558ns (16ns / call)
| # insmod ftrace-ops.ko nr_ops_irrelevant=5 | ftrace_ops: registering: | relevant ops: 1 | tracee: tracee_relevant [ftrace_ops] | tracer: ops_func_nop [ftrace_ops] | irrelevant ops: 5 | tracee: tracee_irrelevant [ftrace_ops] | tracer: ops_func_nop [ftrace_ops] | saving registers: NO | assist recursion: NO | assist RCU: NO | ftrace_ops: Attempted 100000 calls to tracee_relevant [ftrace_ops] in 1693042ns (16ns / call)
| # insmod ftrace-ops.ko nr_ops_relevant=2 | ftrace_ops: registering: | relevant ops: 2 | tracee: tracee_relevant [ftrace_ops] | tracer: ops_func_nop [ftrace_ops] | irrelevant ops: 0 | tracee: tracee_irrelevant [ftrace_ops] | tracer: ops_func_nop [ftrace_ops] | saving registers: NO | assist recursion: NO | assist RCU: NO | ftrace_ops: Attempted 100000 calls to tracee_relevant [ftrace_ops] in 11965582ns (119ns / call)
| # insmod ftrace-ops.ko save_regs=true | ftrace_ops: registering: | relevant ops: 1 | tracee: tracee_relevant [ftrace_ops] | tracer: ops_func_nop [ftrace_ops] | irrelevant ops: 0 | tracee: tracee_irrelevant [ftrace_ops] | tracer: ops_func_nop [ftrace_ops] | saving registers: YES | assist recursion: NO | assist RCU: NO | ftrace_ops: Attempted 100000 calls to tracee_relevant [ftrace_ops] in 4459624ns (44ns / call)
Link: https://lkml.kernel.org/r/20230103124912.2948963-4-mark.rutland@arm.com
Cc: Florent Revest <revest@chromium.org> Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Signed-off-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
show more ...
|
Revision tags: v6.1.2, v6.0.16, v6.1.1, v6.0.15, v6.0.14, v6.0.13, v6.1, v6.0.12, v6.0.11, v6.0.10, v5.15.80, v6.0.9, v5.15.79, v6.0.8, v5.15.78, v6.0.7, v5.15.77, v5.15.76, v6.0.6, v6.0.5, v5.15.75, v6.0.4, v6.0.3, v6.0.2, v5.15.74, v5.15.73, v6.0.1, v5.15.72, v6.0, v5.15.71, v5.15.70, v5.15.69, v5.15.68, v5.15.67, v5.15.66, v5.15.65, v5.15.64, v5.15.63, v5.15.62, v5.15.61, v5.15.60, v5.15.59, v5.19, v5.15.58, v5.15.57, v5.15.56, v5.15.55, v5.15.54, v5.15.53, v5.15.52, v5.15.51, v5.15.50, v5.15.49, v5.15.48, v5.15.47, v5.15.46, v5.15.45, v5.15.44, v5.15.43, v5.15.42, v5.18, v5.15.41, v5.15.40, v5.15.39, v5.15.38, v5.15.37, v5.15.36, v5.15.35, v5.15.34, v5.15.33, v5.15.32, v5.15.31, v5.17, v5.15.30, v5.15.29, v5.15.28, v5.15.27, v5.15.26, v5.15.25, v5.15.24, v5.15.23, v5.15.22, v5.15.21, v5.15.20, v5.15.19, v5.15.18, v5.15.17, v5.4.173, v5.15.16, v5.15.15, v5.16, v5.15.10, v5.15.9, v5.15.8, v5.15.7, v5.15.6, v5.15.5, v5.15.4, v5.15.3, v5.15.2, v5.15.1, v5.15, v5.14.14, v5.14.13, v5.14.12, v5.14.11, v5.14.10, v5.14.9, v5.14.8, v5.14.7, v5.14.6, v5.10.67, v5.10.66, v5.14.5, v5.14.4, v5.10.65, v5.14.3, v5.10.64, v5.14.2, v5.10.63, v5.14.1, v5.10.62, v5.14, v5.10.61, v5.10.60, v5.10.53, v5.10.52, v5.10.51, v5.10.50, v5.10.49 |
|
#
e4fc6580 |
| 03-Jul-2021 |
Miguel Ojeda <ojeda@kernel.org> |
samples: add first Rust examples
The beginning of a set of Rust modules that showcase how Rust modules look like and how to use the abstracted kernel features.
It also includes an example of a Rust
samples: add first Rust examples
The beginning of a set of Rust modules that showcase how Rust modules look like and how to use the abstracted kernel features.
It also includes an example of a Rust host program with several modules.
These samples also double as tests in the CI.
Reviewed-by: Kees Cook <keescook@chromium.org> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Co-developed-by: Alex Gaynor <alex.gaynor@gmail.com> Signed-off-by: Alex Gaynor <alex.gaynor@gmail.com> Co-developed-by: Finn Behrens <me@kloenk.de> Signed-off-by: Finn Behrens <me@kloenk.de> Co-developed-by: Wedson Almeida Filho <wedsonaf@google.com> Signed-off-by: Wedson Almeida Filho <wedsonaf@google.com> Co-developed-by: Milan Landaverde <milan@mdaverde.com> Signed-off-by: Milan Landaverde <milan@mdaverde.com> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
show more ...
|
#
6ee64cc3 |
| 15-Mar-2022 |
Masami Hiramatsu <mhiramat@kernel.org> |
fprobe: Add sample program for fprobe
Add a sample program for the fprobe. The sample_fprobe puts a fprobe on kernel_clone() by default. This dump stack and some called address info at the function
fprobe: Add sample program for fprobe
Add a sample program for the fprobe. The sample_fprobe puts a fprobe on kernel_clone() by default. This dump stack and some called address info at the function entry and exit.
The sample_fprobe.ko gets 2 parameters. - symbol: you can specify the comma separated symbols or wildcard symbol pattern (in this case you can not use comma) - stackdump: a bool value to enable or disable stack dump in the fprobe handler.
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org> Tested-by: Steven Rostedt (Google) <rostedt@goodmis.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/164735291987.1084943.4449670993752806840.stgit@devnote2
show more ...
|
#
953c2f05 |
| 03-Mar-2022 |
Steven Rostedt (Google) <rostedt@goodmis.org> |
tracing: Add sample code for custom trace events
Add sample code to show how to create custom trace events in the tracefs directory that can be enabled and modified like any event in tracefs (includ
tracing: Add sample code for custom trace events
Add sample code to show how to create custom trace events in the tracefs directory that can be enabled and modified like any event in tracefs (including triggers, histograms, synthetic events and event probes).
The example is creating a custom sched_switch and a sched_waking to limit what is recorded:
If the custom sched switch only records the prev_prio, next_prio and next_pid, it can bring the size from 64 bytes per event, down to just 16 bytes!
If sched_waking only records the prio and pid of the woken event, it will bring the size down from 36 bytes to 12 bytes per event.
This will allow for a much smaller footprint into the ring buffer and keep more events from dropping.
Link: https://lkml.kernel.org/r/20220303220625.369226746@goodmis.org
Cc: Ingo Molnar <mingo@kernel.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Tom Zanussi <zanussi@kernel.org> Suggested-by: Joel Fernandes <joel@joelfernandes.org> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
show more ...
|
#
ede5bab8 |
| 24-Nov-2021 |
Mike Leach <mike.leach@linaro.org> |
coresight: syscfg: Example CoreSight configuration loadable module
An example of creating a loadable module to add CoreSight configurations into a system.
In the Kernel samples/coresight directory.
coresight: syscfg: Example CoreSight configuration loadable module
An example of creating a loadable module to add CoreSight configurations into a system.
In the Kernel samples/coresight directory.
Signed-off-by: Mike Leach <mike.leach@linaro.org> Link: https://lore.kernel.org/r/20211124200038.28662-5-mike.leach@linaro.org Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
show more ...
|
#
503e4510 |
| 15-Nov-2021 |
Heiko Carstens <hca@linux.ibm.com> |
ftrace/samples: add missing Kconfig option for ftrace direct multi sample
Currently it is not possible to build the ftrace direct multi example anymore due to broken config dependencies. Fix this by
ftrace/samples: add missing Kconfig option for ftrace direct multi sample
Currently it is not possible to build the ftrace direct multi example anymore due to broken config dependencies. Fix this by adding SAMPLE_FTRACE_DIRECT_MULTI config option.
This broke when merging s390-5.16-1 due to an incorrect merge conflict resolution proposed by me.
Also rename SAMPLE_FTRACE_MULTI_DIRECT to SAMPLE_FTRACE_DIRECT_MULTI so it matches the module name.
Fixes: 0b707e572a19 ("Merge tag 's390-5.16-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux") Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Link: https://lore.kernel.org/r/20211115195614.3173346-2-hca@linux.ibm.com Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
show more ...
|
#
54510930 |
| 25-Oct-2021 |
Gabriel Krisman Bertazi <krisman@collabora.com> |
samples: Add fs error monitoring example
Introduce an example of a FAN_FS_ERROR fanotify user to track filesystem errors.
Link: https://lore.kernel.org/r/20211025192746.66445-31-krisman@collabora.c
samples: Add fs error monitoring example
Introduce an example of a FAN_FS_ERROR fanotify user to track filesystem errors.
Link: https://lore.kernel.org/r/20211025192746.66445-31-krisman@collabora.com Reviewed-by: Amir Goldstein <amir73il@gmail.com> Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com> Signed-off-by: Jan Kara <jack@suse.cz>
show more ...
|
Revision tags: v5.13, v5.10.46, v5.10.43, v5.10.42, v5.10.41, v5.10.40, v5.10.39, v5.4.119, v5.10.36, v5.10.35, v5.10.34, v5.4.116, v5.10.33, v5.12 |
|
#
ba84b0bf |
| 22-Apr-2021 |
Mickaël Salaün <mic@linux.microsoft.com> |
samples/landlock: Add a sandbox manager example
Add a basic sandbox tool to launch a command which can only access a list of file hierarchies in a read-only or read-write way.
Cc: James Morris <jmo
samples/landlock: Add a sandbox manager example
Add a basic sandbox tool to launch a command which can only access a list of file hierarchies in a read-only or read-write way.
Cc: James Morris <jmorris@namei.org> Cc: Serge E. Hallyn <serge@hallyn.com> Signed-off-by: Mickaël Salaün <mic@linux.microsoft.com> Reviewed-by: Jann Horn <jannh@google.com> Reviewed-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/20210422154123.13086-12-mic@digikod.net Signed-off-by: James Morris <jamorris@linux.microsoft.com>
show more ...
|
Revision tags: v5.10.32, v5.10.31, v5.10.30, v5.10.27, v5.10.26, v5.10.25, v5.10.24, v5.10.23, v5.10.22, v5.10.21, v5.10.20, v5.10.19, v5.4.101, v5.10.18, v5.10.17, v5.11, v5.10.16, v5.10.15, v5.10.14, v5.10, v5.8.17, v5.8.16, v5.8.15 |
|
#
1abbef4f |
| 13-Oct-2020 |
Hui Su <sh_def@163.com> |
mm,kmemleak-test.c: move kmemleak-test.c to samples dir
kmemleak-test.c is just a kmemleak test module, which also can not be used as a built-in kernel module. Thus, i think it may should not be in
mm,kmemleak-test.c: move kmemleak-test.c to samples dir
kmemleak-test.c is just a kmemleak test module, which also can not be used as a built-in kernel module. Thus, i think it may should not be in mm dir, and move the kmemleak-test.c to samples/kmemleak/kmemleak-test.c. Fix the spelling of built-in by the way.
Signed-off-by: Hui Su <sh_def@163.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Cc: David S. Miller <davem@davemloft.net> Cc: Rob Herring <robh@kernel.org> Cc: Masahiro Yamada <yamada.masahiro@socionext.com> Cc: Sam Ravnborg <sam@ravnborg.org> Cc: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Steven Rostedt (VMware) <rostedt@goodmis.org> Cc: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> Cc: Divya Indi <divya.indi@oracle.com> Cc: Tomas Winkler <tomas.winkler@intel.com> Cc: David Howells <dhowells@redhat.com> Link: https://lkml.kernel.org/r/20200925183729.GA172837@rlk Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
show more ...
|
Revision tags: v5.9, v5.8.14, v5.8.13, v5.8.12, v5.8.11, v5.8.10, v5.8.9, v5.8.8, v5.8.7, v5.8.6, v5.4.62, v5.8.5, v5.8.4, v5.4.61, v5.8.3, v5.4.60, v5.8.2, v5.4.59, v5.8.1, v5.4.58, v5.4.57, v5.4.56, v5.8, v5.7.12, v5.4.55, v5.7.11, v5.4.54, v5.7.10, v5.4.53, v5.4.52, v5.7.9, v5.7.8, v5.4.51, v5.4.50, v5.7.7, v5.4.49, v5.7.6, v5.7.5, v5.4.48, v5.7.4, v5.7.3, v5.4.47, v5.4.46, v5.7.2, v5.4.45, v5.7.1 |
|
#
fca5e949 |
| 06-Jun-2020 |
Masahiro Yamada <masahiroy@kernel.org> |
samples: binderfs: really compile this sample and fix build issues
Even after commit c624adc9cb6e ("samples: fix binderfs sample"), this sample is never compiled.
'hostprogs' teaches Kbuild that th
samples: binderfs: really compile this sample and fix build issues
Even after commit c624adc9cb6e ("samples: fix binderfs sample"), this sample is never compiled.
'hostprogs' teaches Kbuild that this is a host program, but not enough to order to compile it. You must add it to 'always-y' to really compile it.
Since this sample has never been compiled in upstream, various issues are left unnoticed.
[1] compilers without <linux/android/binderfs.h> are still widely used
<linux/android/binderfs.h> is only available since commit c13295ad219d ("binderfs: rename header to binderfs.h"), i.e., Linux 5.0
If your compiler is based on UAPI headers older than Linux 5.0, you will see the following error:
samples/binderfs/binderfs_example.c:16:10: fatal error: linux/android/binderfs.h: No such file or directory #include <linux/android/binderfs.h> ^~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
You cannot rely on compilers having such a new header.
The common approach is to install UAPI headers of this kernel into usr/include, and then add it to the header search path.
I added 'depends on HEADERS_INSTALL' in Kconfig, and '-I usr/include' compiler flag in Makefile.
[2] compile the sample for target architecture
Because headers_install works for the target architecture, only the native compiler was able to build sample code that requires '-I usr/include'.
Commit 7f3a59db274c ("kbuild: add infrastructure to build userspace programs") added the new syntax 'userprogs' to compile user-space programs for the target architecture.
Use it, and then 'ifndef CROSS_COMPILE' will go away.
I added 'depends on CC_CAN_LINK' because $(CC) is not necessarily capable of linking user-space programs.
[3] use subdir-y to descend into samples/binderfs
Since this directory does not contain any kernel-space code, it has no point in generating built-in.a or modules.order.
Replace obj-$(CONFIG_...) with subdir-$(CONFIG_...).
[4] -Wunused-variable warning
If I compile this, I see the following warning.
samples/binderfs/binderfs_example.c: In function 'main': samples/binderfs/binderfs_example.c:21:9: warning: unused variable 'len' [-Wunused-variable] 21 | size_t len; | ^~~
I removed the unused 'len'.
[5] CONFIG_ANDROID_BINDERFS is not required
Since this is a user-space standalone program, it is independent of the kernel configuration.
Remove 'depends on ANDROID_BINDERFS'.
Fixes: 9762dc1432e1 ("samples: add binderfs sample program") Fixes: c624adc9cb6e ("samples: fix binderfs sample") Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
show more ...
|
Revision tags: v5.4.44, v5.7, v5.4.43, v5.4.42, v5.4.41, v5.4.40, v5.4.39, v5.4.38, v5.4.37, v5.4.36, v5.4.35, v5.4.34, v5.4.33, v5.4.32, v5.4.31, v5.4.30, v5.4.29, v5.6, v5.4.28, v5.4.27, v5.4.26, v5.4.25, v5.4.24, v5.4.23, v5.4.22, v5.4.21, v5.4.20, v5.4.19, v5.4.18, v5.4.17, v5.4.16, v5.5, v5.4.15, v5.4.14, v5.4.13, v5.4.12 |
|
#
f5b5a164 |
| 14-Jan-2020 |
David Howells <dhowells@redhat.com> |
Add sample notification program
The sample program is run like:
./samples/watch_queue/watch_test
and watches "/" for mount changes and the current session keyring for key changes:
# keyctl add
Add sample notification program
The sample program is run like:
./samples/watch_queue/watch_test
and watches "/" for mount changes and the current session keyring for key changes:
# keyctl add user a a @s 1035096409 # keyctl unlink 1035096409 @s
producing:
# ./watch_test read() = 16 NOTIFY[000]: ty=000001 sy=02 i=00000110 KEY 2ffc2e5d change=2[linked] aux=1035096409 read() = 16 NOTIFY[000]: ty=000001 sy=02 i=00000110 KEY 2ffc2e5d change=3[unlinked] aux=1035096409
Other events may be produced, such as with a failing disk:
read() = 22 NOTIFY[000]: ty=000003 sy=02 i=00000416 USB 3-7.7 dev-reset e=0 r=0 read() = 24 NOTIFY[000]: ty=000002 sy=06 i=00000418 BLOCK 00800050 e=6[critical medium] s=64000ef8
This corresponds to:
blk_update_request: critical medium error, dev sdf, sector 1677725432 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
in dmesg.
Signed-off-by: David Howells <dhowells@redhat.com>
show more ...
|
#
88a8e278 |
| 28-Apr-2020 |
Masahiro Yamada <masahiroy@kernel.org> |
samples: watchdog: use 'userprogs' syntax
Kbuild now supports the 'userprogs' syntax to compile userspace programs for the same architecture as the kernel.
Add the entry to samples/Makefile to put
samples: watchdog: use 'userprogs' syntax
Kbuild now supports the 'userprogs' syntax to compile userspace programs for the same architecture as the kernel.
Add the entry to samples/Makefile to put this into the build bot coverage.
I also added the CONFIG option guarded by 'depends on CC_CAN_LINK' because $(CC) may not provide libc.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Acked-by: Sam Ravnborg <sam@ravnborg.org>
show more ...
|
#
b98ccc71 |
| 28-Apr-2020 |
Masahiro Yamada <masahiroy@kernel.org> |
samples: timers: use 'userprogs' syntax
Kbuild now supports the 'userprogs' syntax to compile userspace programs for the same architecture as the kernel.
Add the entry to samples/Makefile to put th
samples: timers: use 'userprogs' syntax
Kbuild now supports the 'userprogs' syntax to compile userspace programs for the same architecture as the kernel.
Add the entry to samples/Makefile to put this into the build bot coverage.
I also added the CONFIG option guarded by 'depends on CC_CAN_LINK' because $(CC) may not provide libc.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Acked-by: Sam Ravnborg <sam@ravnborg.org>
show more ...
|
#
87ffbba9 |
| 28-Apr-2020 |
Masahiro Yamada <masahiroy@kernel.org> |
samples: auxdisplay: use 'userprogs' syntax
Kbuild now supports the 'userprogs' syntax to compile userspace programs for the same architecture as the kernel.
Add the entry to samples/Makefile to pu
samples: auxdisplay: use 'userprogs' syntax
Kbuild now supports the 'userprogs' syntax to compile userspace programs for the same architecture as the kernel.
Add the entry to samples/Makefile to put this into the build bot coverage.
I also added the CONFIG option guarded by 'depends on CC_CAN_LINK' because $(CC) may not provide libc.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Acked-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> Acked-by: Sam Ravnborg <sam@ravnborg.org>
show more ...
|
#
87ecdf4f |
| 28-Apr-2020 |
Masahiro Yamada <masahiroy@kernel.org> |
samples: uhid: build sample program for target architecture
This userspace program includes UAPI headers exported to usr/include/. 'make headers' always works for the target architecture (i.e. the s
samples: uhid: build sample program for target architecture
This userspace program includes UAPI headers exported to usr/include/. 'make headers' always works for the target architecture (i.e. the same architecture as the kernel), so the sample program should be built for the target as well. Kbuild now supports 'userprogs' for that.
Add the entry to samples/Makefile to put this into the build bot coverage.
I also added the CONFIG option guarded by 'depends on CC_CAN_LINK' because $(CC) may not provide libc.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Acked-by: Sam Ravnborg <sam@ravnborg.org>
show more ...
|
#
85e4a889 |
| 23-Apr-2020 |
Masahiro Yamada <masahiroy@kernel.org> |
Revert "objtool: Skip samples subdirectory"
This reverts commit 8728497895794d1f207a836e02dae762ad175d56.
samples/ contains only sub-directories.
Because OBJECT_FILES_NON_STANDARD does not work re
Revert "objtool: Skip samples subdirectory"
This reverts commit 8728497895794d1f207a836e02dae762ad175d56.
samples/ contains only sub-directories.
Because OBJECT_FILES_NON_STANDARD does not work recursively, this line has no effect.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Acked-by: Josh Poimboeuf <jpoimboe@redhat.com> Acked-by: Sam Ravnborg <sam@ravnborg.org>
show more ...
|
#
87284978 |
| 20-Jan-2020 |
Josh Poimboeuf <jpoimboe@redhat.com> |
objtool: Skip samples subdirectory
The code in the 'samples' subdirectory isn't part of the kernel, so there's no need to validate it.
Reported-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-b
objtool: Skip samples subdirectory
The code in the 'samples' subdirectory isn't part of the kernel, so there's no need to validate it.
Reported-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/c4cb4ef635ec606454ab834cb49fc3e9381fb1b1.1579543924.git.jpoimboe@redhat.com
show more ...
|
Revision tags: v5.4.11, v5.4.10, v5.4.9, v5.4.8, v5.4.7, v5.4.6, v5.4.5, v5.4.4, v5.4.3, v5.3.15, v5.4.2, v5.4.1, v5.3.14, v5.4, v5.3.13 |
|
#
89ed4249 |
| 20-Nov-2019 |
Divya Indi <divya.indi@oracle.com> |
tracing: Sample module to demonstrate kernel access to Ftrace instances.
This is a sample module to demonstrate the use of the newly introduced and exported APIs to access Ftrace instances from with
tracing: Sample module to demonstrate kernel access to Ftrace instances.
This is a sample module to demonstrate the use of the newly introduced and exported APIs to access Ftrace instances from within the kernel.
Newly introduced APIs used here -
1. Create/Lookup a trace array with the given name. struct trace_array *trace_array_get_by_name(const char *name)
2. Destroy/Remove a trace array. int trace_array_destroy(struct trace_array *tr)
4. Enable/Disable trace events: int trace_array_set_clr_event(struct trace_array *tr, const char *system, const char *event, bool enable);
Exported APIs - 1. trace_printk equivalent for instances. int trace_array_printk(struct trace_array *tr, unsigned long ip, const char *fmt, ...);
2. Helper function. void trace_printk_init_buffers(void);
3. To decrement the reference counter. void trace_array_put(struct trace_array *tr)
Sample output(contents of /sys/kernel/tracing/instances/sample-instance) NOTE: Tracing disabled after ~5 sec)
_-----=> irqs-off / _----=> need-resched | / _---=> hardirq/softirq || / _--=> preempt-depth ||| / delay TASK-PID CPU# |||| TIMESTAMP FUNCTION | | | |||| | | sample-instance-1452 [002] .... 49.430948: simple_thread: trace_array_printk: count=0 sample-instance-1452 [002] .... 49.430951: sample_event: count value=0 at jiffies=4294716608 sample-instance-1452 [002] .... 50.454847: simple_thread: trace_array_printk: count=1 sample-instance-1452 [002] .... 50.454849: sample_event: count value=1 at jiffies=4294717632 sample-instance-1452 [002] .... 51.478748: simple_thread: trace_array_printk: count=2 sample-instance-1452 [002] .... 51.478750: sample_event: count value=2 at jiffies=4294718656 sample-instance-1452 [002] .... 52.502652: simple_thread: trace_array_printk: count=3 sample-instance-1452 [002] .... 52.502655: sample_event: count value=3 at jiffies=4294719680 sample-instance-1452 [002] .... 53.526533: simple_thread: trace_array_printk: count=4 sample-instance-1452 [002] .... 53.526535: sample_event: count value=4 at jiffies=4294720704 sample-instance-1452 [002] .... 54.550438: simple_thread: trace_array_printk: count=5 sample-instance-1452 [002] .... 55.574336: simple_thread: trace_array_printk: count=6
Link: http://lkml.kernel.org/r/1574276919-11119-3-git-send-email-divya.indi@oracle.com
Reviewed-by: Aruna Ramakrishna <aruna.ramakrishna@oracle.com> Signed-off-by: Divya Indi <divya.indi@oracle.com> [ Moved to samples/ftrace ] Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
show more ...
|
Revision tags: v5.3.12, v5.3.11, v5.3.10 |
|
#
b06457c8 |
| 08-Nov-2019 |
Steven Rostedt (VMware) <rostedt@goodmis.org> |
ftrace: Add sample module that uses register_ftrace_direct()
Add a sample module that shows a simple use case for regsiter_ftrace_direct(), and how to use it.
Signed-off-by: Steven Rostedt (VMware)
ftrace: Add sample module that uses register_ftrace_direct()
Add a sample module that shows a simple use case for regsiter_ftrace_direct(), and how to use it.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
show more ...
|
Revision tags: v5.3.9, v5.3.8, v5.3.7, v5.3.6 |
|
#
6859eba4 |
| 10-Oct-2019 |
Tomas Winkler <tomas.winkler@intel.com> |
samples: mei: use hostprogs kbuild constructs
Use hostprogs kbuild constructs to compile mei sample program mei-amt-version
Add CONFIG_SAMPLE_INTEL_MEI option to enable/disable the feature.
Signed
samples: mei: use hostprogs kbuild constructs
Use hostprogs kbuild constructs to compile mei sample program mei-amt-version
Add CONFIG_SAMPLE_INTEL_MEI option to enable/disable the feature.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Link: https://lore.kernel.org/r/20191010132710.4075-1-tomas.winkler@intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
Revision tags: v5.3.5, v5.3.4, v5.3.3, v5.3.2, v5.3.1, v5.3, v5.2.14, v5.3-rc8, v5.2.13, v5.2.12, v5.2.11, v5.2.10, v5.2.9, v5.2.8, v5.2.7, v5.2.6, v5.2.5, v5.2.4, v5.2.3, v5.2.2, v5.2.1, v5.2, v5.1.16, v5.1.15, v5.1.14, v5.1.13, v5.1.12, v5.1.11, v5.1.10, v5.1.9, v5.1.8 |
|
#
e949f4c2 |
| 04-Jun-2019 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
kbuild: add CONFIG_HEADERS_INSTALL and loosen the dependency of samples
Commit 5318321d367c ("samples: disable CONFIG_SAMPLES for UML") used a big hammer to fix the build errors under the samples/ d
kbuild: add CONFIG_HEADERS_INSTALL and loosen the dependency of samples
Commit 5318321d367c ("samples: disable CONFIG_SAMPLES for UML") used a big hammer to fix the build errors under the samples/ directory. Only some samples actually include uapi headers from usr/include.
Introduce CONFIG_HEADERS_INSTALL since 'depends on HEADERS_INSTALL' is clearer than 'depends on !UML'. If this option is enabled, uapi headers are installed before starting directory descending.
I added 'depends on HEADERS_INSTALL' to per-sample CONFIG options. This allows UML to compile some samples.
$ make ARCH=um allmodconfig samples/ [ snip ] CC [M] samples/configfs/configfs_sample.o CC [M] samples/kfifo/bytestream-example.o CC [M] samples/kfifo/dma-example.o CC [M] samples/kfifo/inttype-example.o CC [M] samples/kfifo/record-example.o CC [M] samples/kobject/kobject-example.o CC [M] samples/kobject/kset-example.o CC [M] samples/trace_events/trace-events-sample.o CC [M] samples/trace_printk/trace-printk.o AR samples/vfio-mdev/built-in.a AR samples/built-in.a
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
show more ...
|
Revision tags: v5.1.7, v5.1.6, v5.1.5, v5.1.4, v5.1.3, v5.1.2, v5.1.1 |
|
#
6944a06d |
| 08-May-2019 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
samples: guard sub-directories with CONFIG options
Do not descend to sub-directories when unneeded.
I used subdir-$(CONFIG_...) for hidraw, seccomp, and vfs because they only contain host programs.
samples: guard sub-directories with CONFIG options
Do not descend to sub-directories when unneeded.
I used subdir-$(CONFIG_...) for hidraw, seccomp, and vfs because they only contain host programs.
While we are here, let's add SPDX License tag, and sort the directories alphabetically.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
show more ...
|
Revision tags: v5.0.14, v5.1, v5.0.13, v5.0.12, v5.0.11, v5.0.10, v5.0.9, v5.0.8 |
|
#
43c6afee |
| 07-Apr-2019 |
Christian Brauner <christian@brauner.io> |
samples: show race-free pidfd metadata access
This is a sample program showing userspace how to get race-free access to process metadata from a pidfd. It is rather easy to do and userspace can actu
samples: show race-free pidfd metadata access
This is a sample program showing userspace how to get race-free access to process metadata from a pidfd. It is rather easy to do and userspace can actually simply reuse code that currently parses a process's status file in procfs. The program can easily be extended into a generic helper suitable for inclusion in a libc to make it even easier for userspace to gain metadata access.
Since this came up in a discussion because this API is going to be used in various service managers: A lot of programs will have a whitelist seccomp filter that returns <some-errno> for all new syscalls. This means that programs might get confused if CLONE_PIDFD works but the later pidfd_send_signal() syscall doesn't. Hence, here's a ahead of time check that pidfd_send_signal() is supported:
bool pidfd_send_signal_supported() { int procfd = open("/proc/self", O_DIRECTORY | O_RDONLY | O_CLOEXEC); if (procfd < 0) return false;
/* * A process is always allowed to signal itself so * pidfd_send_signal() should never fail this test. If it does * it must mean it is not available, blocked by an LSM, seccomp, * or other. */ return pidfd_send_signal(procfd, 0, NULL, 0) == 0; }
Signed-off-by: Christian Brauner <christian@brauner.io> Co-developed-by: Jann Horn <jannh@google.com> Signed-off-by: Jann Horn <jannh@google.com> Reviewed-by: Oleg Nesterov <oleg@redhat.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Kees Cook <keescook@chromium.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: David Howells <dhowells@redhat.com> Cc: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com> Cc: Andy Lutomirsky <luto@kernel.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Aleksa Sarai <cyphar@cyphar.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Al Viro <viro@zeniv.linux.org.uk>
show more ...
|