Merge branch 'tip/perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace into perf/core
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/kernel_stat.h>
|
||||
|
||||
#include <trace/events/irq.h>
|
||||
|
||||
#include "internals.h"
|
||||
|
||||
/**
|
||||
|
@@ -44,6 +44,9 @@
|
||||
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
#define CREATE_TRACE_POINTS
|
||||
#include <trace/events/printk.h>
|
||||
|
||||
/*
|
||||
* Architectures can override it:
|
||||
*/
|
||||
@@ -542,6 +545,8 @@ MODULE_PARM_DESC(ignore_loglevel, "ignore loglevel setting, to"
|
||||
static void _call_console_drivers(unsigned start,
|
||||
unsigned end, int msg_log_level)
|
||||
{
|
||||
trace_console(&LOG_BUF(0), start, end, log_buf_len);
|
||||
|
||||
if ((msg_log_level < console_loglevel || ignore_loglevel) &&
|
||||
console_drivers && start != end) {
|
||||
if ((start & LOG_BUF_MASK) > (end & LOG_BUF_MASK)) {
|
||||
|
@@ -385,6 +385,12 @@ void raise_softirq(unsigned int nr)
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
void __raise_softirq_irqoff(unsigned int nr)
|
||||
{
|
||||
trace_softirq_raise(nr);
|
||||
or_softirq_pending(1UL << nr);
|
||||
}
|
||||
|
||||
void open_softirq(int nr, void (*action)(struct softirq_action *))
|
||||
{
|
||||
softirq_vec[nr].action = action;
|
||||
|
@@ -1129,7 +1129,7 @@ static struct ftrace_hash *alloc_ftrace_hash(int size_bits)
|
||||
return NULL;
|
||||
|
||||
size = 1 << size_bits;
|
||||
hash->buckets = kzalloc(sizeof(*hash->buckets) * size, GFP_KERNEL);
|
||||
hash->buckets = kcalloc(size, sizeof(*hash->buckets), GFP_KERNEL);
|
||||
|
||||
if (!hash->buckets) {
|
||||
kfree(hash);
|
||||
@@ -3146,8 +3146,10 @@ ftrace_set_regex(struct ftrace_ops *ops, unsigned char *buf, int len,
|
||||
mutex_lock(&ftrace_regex_lock);
|
||||
if (reset)
|
||||
ftrace_filter_reset(hash);
|
||||
if (buf)
|
||||
ftrace_match_records(hash, buf, len);
|
||||
if (buf && !ftrace_match_records(hash, buf, len)) {
|
||||
ret = -EINVAL;
|
||||
goto out_regex_unlock;
|
||||
}
|
||||
|
||||
mutex_lock(&ftrace_lock);
|
||||
ret = ftrace_hash_move(ops, enable, orig_hash, hash);
|
||||
@@ -3157,6 +3159,7 @@ ftrace_set_regex(struct ftrace_ops *ops, unsigned char *buf, int len,
|
||||
|
||||
mutex_unlock(&ftrace_lock);
|
||||
|
||||
out_regex_unlock:
|
||||
mutex_unlock(&ftrace_regex_lock);
|
||||
|
||||
free_ftrace_hash(hash);
|
||||
@@ -3173,10 +3176,10 @@ ftrace_set_regex(struct ftrace_ops *ops, unsigned char *buf, int len,
|
||||
* Filters denote which functions should be enabled when tracing is enabled.
|
||||
* If @buf is NULL and reset is set, all functions will be enabled for tracing.
|
||||
*/
|
||||
void ftrace_set_filter(struct ftrace_ops *ops, unsigned char *buf,
|
||||
int ftrace_set_filter(struct ftrace_ops *ops, unsigned char *buf,
|
||||
int len, int reset)
|
||||
{
|
||||
ftrace_set_regex(ops, buf, len, reset, 1);
|
||||
return ftrace_set_regex(ops, buf, len, reset, 1);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(ftrace_set_filter);
|
||||
|
||||
@@ -3191,10 +3194,10 @@ EXPORT_SYMBOL_GPL(ftrace_set_filter);
|
||||
* is enabled. If @buf is NULL and reset is set, all functions will be enabled
|
||||
* for tracing.
|
||||
*/
|
||||
void ftrace_set_notrace(struct ftrace_ops *ops, unsigned char *buf,
|
||||
int ftrace_set_notrace(struct ftrace_ops *ops, unsigned char *buf,
|
||||
int len, int reset)
|
||||
{
|
||||
ftrace_set_regex(ops, buf, len, reset, 0);
|
||||
return ftrace_set_regex(ops, buf, len, reset, 0);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(ftrace_set_notrace);
|
||||
/**
|
||||
|
@@ -2764,12 +2764,12 @@ static const char readme_msg[] =
|
||||
"tracing mini-HOWTO:\n\n"
|
||||
"# mount -t debugfs nodev /sys/kernel/debug\n\n"
|
||||
"# cat /sys/kernel/debug/tracing/available_tracers\n"
|
||||
"wakeup preemptirqsoff preemptoff irqsoff function sched_switch nop\n\n"
|
||||
"wakeup wakeup_rt preemptirqsoff preemptoff irqsoff function nop\n\n"
|
||||
"# cat /sys/kernel/debug/tracing/current_tracer\n"
|
||||
"nop\n"
|
||||
"# echo sched_switch > /sys/kernel/debug/tracing/current_tracer\n"
|
||||
"# echo wakeup > /sys/kernel/debug/tracing/current_tracer\n"
|
||||
"# cat /sys/kernel/debug/tracing/current_tracer\n"
|
||||
"sched_switch\n"
|
||||
"wakeup\n"
|
||||
"# cat /sys/kernel/debug/tracing/trace_options\n"
|
||||
"noprint-parent nosym-offset nosym-addr noverbose\n"
|
||||
"# echo print-parent > /sys/kernel/debug/tracing/trace_options\n"
|
||||
|
@@ -685,7 +685,7 @@ find_event_field(struct ftrace_event_call *call, char *name)
|
||||
|
||||
static int __alloc_pred_stack(struct pred_stack *stack, int n_preds)
|
||||
{
|
||||
stack->preds = kzalloc(sizeof(*stack->preds)*(n_preds + 1), GFP_KERNEL);
|
||||
stack->preds = kcalloc(n_preds + 1, sizeof(*stack->preds), GFP_KERNEL);
|
||||
if (!stack->preds)
|
||||
return -ENOMEM;
|
||||
stack->index = n_preds;
|
||||
@@ -826,8 +826,7 @@ static int __alloc_preds(struct event_filter *filter, int n_preds)
|
||||
if (filter->preds)
|
||||
__free_preds(filter);
|
||||
|
||||
filter->preds =
|
||||
kzalloc(sizeof(*filter->preds) * n_preds, GFP_KERNEL);
|
||||
filter->preds = kcalloc(n_preds, sizeof(*filter->preds), GFP_KERNEL);
|
||||
|
||||
if (!filter->preds)
|
||||
return -ENOMEM;
|
||||
@@ -1486,7 +1485,7 @@ static int fold_pred(struct filter_pred *preds, struct filter_pred *root)
|
||||
children = count_leafs(preds, &preds[root->left]);
|
||||
children += count_leafs(preds, &preds[root->right]);
|
||||
|
||||
root->ops = kzalloc(sizeof(*root->ops) * children, GFP_KERNEL);
|
||||
root->ops = kcalloc(children, sizeof(*root->ops), GFP_KERNEL);
|
||||
if (!root->ops)
|
||||
return -ENOMEM;
|
||||
|
||||
|
@@ -468,8 +468,8 @@ int __init init_ftrace_syscalls(void)
|
||||
unsigned long addr;
|
||||
int i;
|
||||
|
||||
syscalls_metadata = kzalloc(sizeof(*syscalls_metadata) *
|
||||
NR_syscalls, GFP_KERNEL);
|
||||
syscalls_metadata = kcalloc(NR_syscalls, sizeof(*syscalls_metadata),
|
||||
GFP_KERNEL);
|
||||
if (!syscalls_metadata) {
|
||||
WARN_ON(1);
|
||||
return -ENOMEM;
|
||||
|
Reference in New Issue
Block a user