Merge branch 'tracing/urgent' into tracing/core
Merge reason: Pick up fixes and move base from -rc1 to -rc5. Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
@@ -855,6 +855,37 @@ static void blk_add_trace_remap(struct request_queue *q, struct bio *bio,
|
||||
sizeof(r), &r);
|
||||
}
|
||||
|
||||
/**
|
||||
* blk_add_trace_rq_remap - Add a trace for a request-remap operation
|
||||
* @q: queue the io is for
|
||||
* @rq: the source request
|
||||
* @dev: target device
|
||||
* @from: source sector
|
||||
*
|
||||
* Description:
|
||||
* Device mapper remaps request to other devices.
|
||||
* Add a trace for that action.
|
||||
*
|
||||
**/
|
||||
static void blk_add_trace_rq_remap(struct request_queue *q,
|
||||
struct request *rq, dev_t dev,
|
||||
sector_t from)
|
||||
{
|
||||
struct blk_trace *bt = q->blk_trace;
|
||||
struct blk_io_trace_remap r;
|
||||
|
||||
if (likely(!bt))
|
||||
return;
|
||||
|
||||
r.device_from = cpu_to_be32(dev);
|
||||
r.device_to = cpu_to_be32(disk_devt(rq->rq_disk));
|
||||
r.sector_from = cpu_to_be64(from);
|
||||
|
||||
__blk_add_trace(bt, blk_rq_pos(rq), blk_rq_bytes(rq),
|
||||
rq_data_dir(rq), BLK_TA_REMAP, !!rq->errors,
|
||||
sizeof(r), &r);
|
||||
}
|
||||
|
||||
/**
|
||||
* blk_add_driver_data - Add binary message with driver-specific data
|
||||
* @q: queue the io is for
|
||||
@@ -922,10 +953,13 @@ static void blk_register_tracepoints(void)
|
||||
WARN_ON(ret);
|
||||
ret = register_trace_block_remap(blk_add_trace_remap);
|
||||
WARN_ON(ret);
|
||||
ret = register_trace_block_rq_remap(blk_add_trace_rq_remap);
|
||||
WARN_ON(ret);
|
||||
}
|
||||
|
||||
static void blk_unregister_tracepoints(void)
|
||||
{
|
||||
unregister_trace_block_rq_remap(blk_add_trace_rq_remap);
|
||||
unregister_trace_block_remap(blk_add_trace_remap);
|
||||
unregister_trace_block_split(blk_add_trace_split);
|
||||
unregister_trace_block_unplug_io(blk_add_trace_unplug_io);
|
||||
@@ -1657,6 +1691,11 @@ int blk_trace_init_sysfs(struct device *dev)
|
||||
return sysfs_create_group(&dev->kobj, &blk_trace_attr_group);
|
||||
}
|
||||
|
||||
void blk_trace_remove_sysfs(struct device *dev)
|
||||
{
|
||||
sysfs_remove_group(&dev->kobj, &blk_trace_attr_group);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_BLK_DEV_IO_TRACE */
|
||||
|
||||
#ifdef CONFIG_EVENT_TRACING
|
||||
|
||||
@@ -751,7 +751,7 @@ ftrace_profile_write(struct file *filp, const char __user *ubuf,
|
||||
out:
|
||||
mutex_unlock(&ftrace_profile_lock);
|
||||
|
||||
filp->f_pos += cnt;
|
||||
*ppos += cnt;
|
||||
|
||||
return cnt;
|
||||
}
|
||||
|
||||
@@ -501,7 +501,7 @@ static int __init init_kmem_tracer(void)
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!register_tracer(&kmem_tracer)) {
|
||||
if (register_tracer(&kmem_tracer) != 0) {
|
||||
pr_warning("Warning: could not register the kmem tracer\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -483,7 +483,7 @@ struct ring_buffer_iter {
|
||||
/* Up this if you want to test the TIME_EXTENTS and normalization */
|
||||
#define DEBUG_SHIFT 0
|
||||
|
||||
static inline u64 rb_time_stamp(struct ring_buffer *buffer, int cpu)
|
||||
static inline u64 rb_time_stamp(struct ring_buffer *buffer)
|
||||
{
|
||||
/* shift to debug/test normalization and TIME_EXTENTS */
|
||||
return buffer->clock() << DEBUG_SHIFT;
|
||||
@@ -494,7 +494,7 @@ u64 ring_buffer_time_stamp(struct ring_buffer *buffer, int cpu)
|
||||
u64 time;
|
||||
|
||||
preempt_disable_notrace();
|
||||
time = rb_time_stamp(buffer, cpu);
|
||||
time = rb_time_stamp(buffer);
|
||||
preempt_enable_no_resched_notrace();
|
||||
|
||||
return time;
|
||||
@@ -599,7 +599,7 @@ static struct list_head *rb_list_head(struct list_head *list)
|
||||
}
|
||||
|
||||
/*
|
||||
* rb_is_head_page - test if the give page is the head page
|
||||
* rb_is_head_page - test if the given page is the head page
|
||||
*
|
||||
* Because the reader may move the head_page pointer, we can
|
||||
* not trust what the head page is (it may be pointing to
|
||||
@@ -1868,7 +1868,7 @@ rb_move_tail(struct ring_buffer_per_cpu *cpu_buffer,
|
||||
* Nested commits always have zero deltas, so
|
||||
* just reread the time stamp
|
||||
*/
|
||||
*ts = rb_time_stamp(buffer, cpu_buffer->cpu);
|
||||
*ts = rb_time_stamp(buffer);
|
||||
next_page->page->time_stamp = *ts;
|
||||
}
|
||||
|
||||
@@ -2111,7 +2111,7 @@ rb_reserve_next_event(struct ring_buffer *buffer,
|
||||
if (RB_WARN_ON(cpu_buffer, ++nr_loops > 1000))
|
||||
goto out_fail;
|
||||
|
||||
ts = rb_time_stamp(cpu_buffer->buffer, cpu_buffer->cpu);
|
||||
ts = rb_time_stamp(cpu_buffer->buffer);
|
||||
|
||||
/*
|
||||
* Only the first commit can update the timestamp.
|
||||
@@ -2681,7 +2681,7 @@ unsigned long ring_buffer_entries(struct ring_buffer *buffer)
|
||||
EXPORT_SYMBOL_GPL(ring_buffer_entries);
|
||||
|
||||
/**
|
||||
* ring_buffer_overrun_cpu - get the number of overruns in buffer
|
||||
* ring_buffer_overruns - get the number of overruns in buffer
|
||||
* @buffer: The ring buffer
|
||||
*
|
||||
* Returns the total number of overruns in the ring buffer
|
||||
|
||||
@@ -2440,7 +2440,7 @@ tracing_trace_options_write(struct file *filp, const char __user *ubuf,
|
||||
return ret;
|
||||
}
|
||||
|
||||
filp->f_pos += cnt;
|
||||
*ppos += cnt;
|
||||
|
||||
return cnt;
|
||||
}
|
||||
@@ -2582,7 +2582,7 @@ tracing_ctrl_write(struct file *filp, const char __user *ubuf,
|
||||
}
|
||||
mutex_unlock(&trace_types_lock);
|
||||
|
||||
filp->f_pos += cnt;
|
||||
*ppos += cnt;
|
||||
|
||||
return cnt;
|
||||
}
|
||||
@@ -2764,7 +2764,7 @@ tracing_set_trace_write(struct file *filp, const char __user *ubuf,
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
filp->f_pos += ret;
|
||||
*ppos += ret;
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -3299,7 +3299,7 @@ tracing_entries_write(struct file *filp, const char __user *ubuf,
|
||||
}
|
||||
}
|
||||
|
||||
filp->f_pos += cnt;
|
||||
*ppos += cnt;
|
||||
|
||||
/* If check pages failed, return ENOMEM */
|
||||
if (tracing_disabled)
|
||||
|
||||
@@ -69,6 +69,9 @@ enum print_line_t trace_print_printk_msg_only(struct trace_iterator *iter)
|
||||
* @s: trace sequence descriptor
|
||||
* @fmt: printf format string
|
||||
*
|
||||
* It returns 0 if the trace oversizes the buffer's free
|
||||
* space, 1 otherwise.
|
||||
*
|
||||
* The tracer may use either sequence operations or its own
|
||||
* copy to user routines. To simplify formating of a trace
|
||||
* trace_seq_printf is used to store strings into a special
|
||||
@@ -95,7 +98,7 @@ trace_seq_printf(struct trace_seq *s, const char *fmt, ...)
|
||||
|
||||
s->len += ret;
|
||||
|
||||
return len;
|
||||
return 1;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(trace_seq_printf);
|
||||
|
||||
|
||||
@@ -229,7 +229,7 @@ int syscall_exit_format(struct ftrace_event_call *call, struct trace_seq *s)
|
||||
"\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n"
|
||||
"\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n",
|
||||
SYSCALL_FIELD(int, nr),
|
||||
SYSCALL_FIELD(unsigned long, ret));
|
||||
SYSCALL_FIELD(long, ret));
|
||||
if (!ret)
|
||||
return 0;
|
||||
|
||||
@@ -275,7 +275,7 @@ int syscall_exit_define_fields(struct ftrace_event_call *call)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = trace_define_field(call, SYSCALL_FIELD(unsigned long, ret), 0,
|
||||
ret = trace_define_field(call, SYSCALL_FIELD(long, ret), 0,
|
||||
FILTER_OTHER);
|
||||
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user