Skip to content

Commit

Permalink
Merge branch 'tracing-fixes-for-linus' of git://git.kernel.org/pub/sc…
Browse files Browse the repository at this point in the history
…m/linux/kernel/git/tip/linux-2.6-tip

* 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  tracing: Remove cpu arg from the rb_time_stamp() function
  tracing: Fix comment typo and documentation example
  tracing: Fix trace_seq_printf() return value
  tracing: Update *ppos instead of filp->f_pos
  • Loading branch information
Linus Torvalds committed Nov 2, 2009
2 parents efcd9e0 + 6d3f1e1 commit a5e3013
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 13 deletions.
2 changes: 2 additions & 0 deletions Documentation/trace/ftrace.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1231,6 +1231,7 @@ something like this simple program:
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>

#define _STR(x) #x
#define STR(x) _STR(x)
Expand Down Expand Up @@ -1265,6 +1266,7 @@ const char *find_debugfs(void)
return NULL;
}

strcat(debugfs, "/tracing/");
debugfs_found = 1;

return debugfs;
Expand Down
2 changes: 1 addition & 1 deletion include/linux/trace_seq.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/*
* Trace sequences are used to allow a function to call several other functions
* to create a string of data to use (up to a max of PAGE_SIZE.
* to create a string of data to use (up to a max of PAGE_SIZE).
*/

struct trace_seq {
Expand Down
2 changes: 1 addition & 1 deletion kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,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;
}
Expand Down
12 changes: 6 additions & 6 deletions kernel/trace/ring_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion kernel/trace/trace_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);

Expand Down

0 comments on commit a5e3013

Please sign in to comment.