forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'trace-v4.10' of git://git.kernel.org/pub/scm/linux/kernel/…
…git/rostedt/linux-trace Pull tracing updates from Steven Rostedt: "This release has a few updates: - STM can hook into the function tracer - Function filtering now supports more advance glob matching - Ftrace selftests updates and added tests - Softirq tag in traces now show only softirqs - ARM nop added to non traced locations at compile time - New trace_marker_raw file that allows for binary input - Optimizations to the ring buffer - Removal of kmap in trace_marker - Wakeup and irqsoff tracers now adhere to the set_graph_notrace file - Other various fixes and clean ups" * tag 'trace-v4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (42 commits) selftests: ftrace: Shift down default message verbosity kprobes/trace: Fix kprobe selftest for newer gcc tracing/kprobes: Add a helper method to return number of probe hits tracing/rb: Init the CPU mask on allocation tracing: Use SOFTIRQ_OFFSET for softirq dectection for more accurate results tracing/fgraph: Have wakeup and irqsoff tracers ignore graph functions too fgraph: Handle a case where a tracer ignores set_graph_notrace tracing: Replace kmap with copy_from_user() in trace_marker writing ftrace/x86_32: Set ftrace_stub to weak to prevent gcc from using short jumps to it tracing: Allow benchmark to be enabled at early_initcall() tracing: Have system enable return error if one of the events fail tracing: Do not start benchmark on boot up tracing: Have the reg function allow to fail ring-buffer: Force rb_end_commit() and rb_set_commit_to_write() inline ring-buffer: Froce rb_update_write_stamp() to be inlined ring-buffer: Force inline of hotpath helper functions tracing: Make __buffer_unlock_commit() always_inline tracing: Make tracepoint_printk a static_key ring-buffer: Always inline rb_event_data() ring-buffer: Make rb_reserve_next_event() always inlined ...
- Loading branch information
Showing
52 changed files
with
1,064 additions
and
300 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
/* | ||
* Simple kernel driver to link kernel Ftrace and an STM device | ||
* Copyright (c) 2016, Linaro Ltd. | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms and conditions of the GNU General Public License, | ||
* version 2, as published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
* more details. | ||
* | ||
* STM Ftrace will be registered as a trace_export. | ||
*/ | ||
|
||
#include <linux/module.h> | ||
#include <linux/stm.h> | ||
#include <linux/trace.h> | ||
|
||
#define STM_FTRACE_NR_CHANNELS 1 | ||
#define STM_FTRACE_CHAN 0 | ||
|
||
static int stm_ftrace_link(struct stm_source_data *data); | ||
static void stm_ftrace_unlink(struct stm_source_data *data); | ||
|
||
static struct stm_ftrace { | ||
struct stm_source_data data; | ||
struct trace_export ftrace; | ||
} stm_ftrace = { | ||
.data = { | ||
.name = "ftrace", | ||
.nr_chans = STM_FTRACE_NR_CHANNELS, | ||
.link = stm_ftrace_link, | ||
.unlink = stm_ftrace_unlink, | ||
}, | ||
}; | ||
|
||
/** | ||
* stm_ftrace_write() - write data to STM via 'stm_ftrace' source | ||
* @buf: buffer containing the data packet | ||
* @len: length of the data packet | ||
*/ | ||
static void notrace | ||
stm_ftrace_write(const void *buf, unsigned int len) | ||
{ | ||
stm_source_write(&stm_ftrace.data, STM_FTRACE_CHAN, buf, len); | ||
} | ||
|
||
static int stm_ftrace_link(struct stm_source_data *data) | ||
{ | ||
struct stm_ftrace *sf = container_of(data, struct stm_ftrace, data); | ||
|
||
sf->ftrace.write = stm_ftrace_write; | ||
|
||
return register_ftrace_export(&sf->ftrace); | ||
} | ||
|
||
static void stm_ftrace_unlink(struct stm_source_data *data) | ||
{ | ||
struct stm_ftrace *sf = container_of(data, struct stm_ftrace, data); | ||
|
||
unregister_ftrace_export(&sf->ftrace); | ||
} | ||
|
||
static int __init stm_ftrace_init(void) | ||
{ | ||
int ret; | ||
|
||
ret = stm_source_register_device(NULL, &stm_ftrace.data); | ||
if (ret) | ||
pr_err("Failed to register stm_source - ftrace.\n"); | ||
|
||
return ret; | ||
} | ||
|
||
static void __exit stm_ftrace_exit(void) | ||
{ | ||
stm_source_unregister_device(&stm_ftrace.data); | ||
} | ||
|
||
module_init(stm_ftrace_init); | ||
module_exit(stm_ftrace_exit); | ||
|
||
MODULE_LICENSE("GPL v2"); | ||
MODULE_DESCRIPTION("stm_ftrace driver"); | ||
MODULE_AUTHOR("Chunyan Zhang <[email protected]>"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#ifndef _LINUX_TRACE_H | ||
#define _LINUX_TRACE_H | ||
|
||
#ifdef CONFIG_TRACING | ||
/* | ||
* The trace export - an export of Ftrace output. The trace_export | ||
* can process traces and export them to a registered destination as | ||
* an addition to the current only output of Ftrace - i.e. ring buffer. | ||
* | ||
* If you want traces to be sent to some other place rather than ring | ||
* buffer only, just need to register a new trace_export and implement | ||
* its own .write() function for writing traces to the storage. | ||
* | ||
* next - pointer to the next trace_export | ||
* write - copy traces which have been delt with ->commit() to | ||
* the destination | ||
*/ | ||
struct trace_export { | ||
struct trace_export __rcu *next; | ||
void (*write)(const void *, unsigned int); | ||
}; | ||
|
||
int register_ftrace_export(struct trace_export *export); | ||
int unregister_ftrace_export(struct trace_export *export); | ||
|
||
#endif /* CONFIG_TRACING */ | ||
|
||
#endif /* _LINUX_TRACE_H */ |
Oops, something went wrong.