提交 fec896e2 编写于 作者: L Linus Torvalds

Merge branch 'perf-fixes-for-linus' of...

Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  ring-buffer: Fix typo of time extends per page
  perf, MIPS: Support cross compiling of tools/perf for MIPS
  perf: Fix incorrect copy_from_user() usage
...@@ -2202,15 +2202,13 @@ static void perf_event_for_each(struct perf_event *event, ...@@ -2202,15 +2202,13 @@ static void perf_event_for_each(struct perf_event *event,
static int perf_event_period(struct perf_event *event, u64 __user *arg) static int perf_event_period(struct perf_event *event, u64 __user *arg)
{ {
struct perf_event_context *ctx = event->ctx; struct perf_event_context *ctx = event->ctx;
unsigned long size;
int ret = 0; int ret = 0;
u64 value; u64 value;
if (!event->attr.sample_period) if (!event->attr.sample_period)
return -EINVAL; return -EINVAL;
size = copy_from_user(&value, arg, sizeof(value)); if (copy_from_user(&value, arg, sizeof(value)))
if (size != sizeof(value))
return -EFAULT; return -EFAULT;
if (!value) if (!value)
......
...@@ -405,7 +405,7 @@ static inline int test_time_stamp(u64 delta) ...@@ -405,7 +405,7 @@ static inline int test_time_stamp(u64 delta)
#define BUF_MAX_DATA_SIZE (BUF_PAGE_SIZE - (sizeof(u32) * 2)) #define BUF_MAX_DATA_SIZE (BUF_PAGE_SIZE - (sizeof(u32) * 2))
/* Max number of timestamps that can fit on a page */ /* Max number of timestamps that can fit on a page */
#define RB_TIMESTAMPS_PER_PAGE (BUF_PAGE_SIZE / RB_LEN_TIME_STAMP) #define RB_TIMESTAMPS_PER_PAGE (BUF_PAGE_SIZE / RB_LEN_TIME_EXTEND)
int ring_buffer_print_page_header(struct trace_seq *s) int ring_buffer_print_page_header(struct trace_seq *s)
{ {
......
...@@ -73,6 +73,18 @@ void get_term_dimensions(struct winsize *ws); ...@@ -73,6 +73,18 @@ void get_term_dimensions(struct winsize *ws);
#define cpu_relax() asm volatile("":::"memory") #define cpu_relax() asm volatile("":::"memory")
#endif #endif
#ifdef __mips__
#include "../../arch/mips/include/asm/unistd.h"
#define rmb() asm volatile( \
".set mips2\n\t" \
"sync\n\t" \
".set mips0" \
: /* no output */ \
: /* no input */ \
: "memory")
#define cpu_relax() asm volatile("" ::: "memory")
#endif
#include <time.h> #include <time.h>
#include <unistd.h> #include <unistd.h>
#include <sys/types.h> #include <sys/types.h>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册