]> git.pld-linux.org Git - packages/kernel.git/blob - 2.6.0-t3-oprofile-2of3-lkml.patch
- obsolete
[packages/kernel.git] / 2.6.0-t3-oprofile-2of3-lkml.patch
1 diff -X dontdiff -Naur linux-cvs/drivers/oprofile/oprofile_files.c linux-fixes/drivers/oprofile/oprofile_files.c
2 --- linux-cvs/drivers/oprofile/oprofile_files.c 2003-06-15 02:06:38.000000000 +0100
3 +++ linux-fixes/drivers/oprofile/oprofile_files.c       2003-08-14 19:19:05.000000000 +0100
4 @@ -19,6 +19,17 @@
5  unsigned long fs_buffer_watershed = 32768; /* FIXME: tune */
6  
7   
8 +static ssize_t pointer_size_read(struct file * file, char * buf, size_t count, loff_t * offset)
9 +{
10 +       return oprofilefs_ulong_to_user((unsigned long)sizeof(void *), buf, count, offset);
11 +}
12 +
13 +
14 +static struct file_operations pointer_size_fops = {
15 +       .read           = pointer_size_read,
16 +};
17 +
18 +
19  static ssize_t cpu_type_read(struct file * file, char * buf, size_t count, loff_t * offset)
20  {
21         return oprofilefs_str_to_user(oprofile_ops->cpu_type, buf, count, offset);
22 @@ -32,7 +43,7 @@
23   
24  static ssize_t enable_read(struct file * file, char * buf, size_t count, loff_t * offset)
25  {
26 -       return oprofilefs_ulong_to_user(&oprofile_started, buf, count, offset);
27 +       return oprofilefs_ulong_to_user(oprofile_started, buf, count, offset);
28  }
29  
30  
31 @@ -85,6 +96,7 @@
32         oprofilefs_create_ulong(sb, root, "buffer_watershed", &fs_buffer_watershed);
33         oprofilefs_create_ulong(sb, root, "cpu_buffer_size", &fs_cpu_buffer_size);
34         oprofilefs_create_file(sb, root, "cpu_type", &cpu_type_fops); 
35 +       oprofilefs_create_file(sb, root, "pointer_size", &pointer_size_fops);
36         oprofile_create_stats_files(sb, root);
37         if (oprofile_ops->create_files)
38                 oprofile_ops->create_files(sb, root);
39 diff -X dontdiff -Naur linux-cvs/drivers/oprofile/oprofilefs.c linux-fixes/drivers/oprofile/oprofilefs.c
40 --- linux-cvs/drivers/oprofile/oprofilefs.c     2003-05-26 02:04:50.000000000 +0100
41 +++ linux-fixes/drivers/oprofile/oprofilefs.c   2003-08-14 19:21:16.000000000 +0100
42 @@ -69,7 +69,7 @@
43  
44  #define TMPBUFSIZE 50
45  
46 -ssize_t oprofilefs_ulong_to_user(unsigned long * val, char * buf, size_t count, loff_t * offset)
47 +ssize_t oprofilefs_ulong_to_user(unsigned long val, char * buf, size_t count, loff_t * offset)
48  {
49         char tmpbuf[TMPBUFSIZE];
50         size_t maxlen;
51 @@ -78,7 +78,7 @@
52                 return 0;
53  
54         spin_lock(&oprofilefs_lock);
55 -       maxlen = snprintf(tmpbuf, TMPBUFSIZE, "%lu\n", *val);
56 +       maxlen = snprintf(tmpbuf, TMPBUFSIZE, "%lu\n", val);
57         spin_unlock(&oprofilefs_lock);
58         if (maxlen > TMPBUFSIZE)
59                 maxlen = TMPBUFSIZE;
60 @@ -122,7 +122,8 @@
61  
62  static ssize_t ulong_read_file(struct file * file, char * buf, size_t count, loff_t * offset)
63  {
64 -       return oprofilefs_ulong_to_user(file->private_data, buf, count, offset);
65 +       unsigned long * val = file->private_data;
66 +       return oprofilefs_ulong_to_user(*val, buf, count, offset);
67  }
68  
69  
70 @@ -212,9 +213,8 @@
71  
72  static ssize_t atomic_read_file(struct file * file, char * buf, size_t count, loff_t * offset)
73  {
74 -       atomic_t * aval = file->private_data;
75 -       unsigned long val = atomic_read(aval);
76 -       return oprofilefs_ulong_to_user(&val, buf, count, offset);
77 +       atomic_t * val = file->private_data;
78 +       return oprofilefs_ulong_to_user(atomic_read(val), buf, count, offset);
79  }
80   
81  
82 diff -X dontdiff -Naur linux-cvs/include/linux/oprofile.h linux-fixes/include/linux/oprofile.h
83 --- linux-cvs/include/linux/oprofile.h  2003-06-15 02:06:38.000000000 +0100
84 +++ linux-fixes/include/linux/oprofile.h        2003-08-14 19:19:42.000000000 +0100
85 @@ -92,7 +92,7 @@
86   * Convert an unsigned long value into ASCII and copy it to the user buffer @buf,
87   * updating *offset appropriately. Returns bytes written or -EFAULT.
88   */
89 -ssize_t oprofilefs_ulong_to_user(unsigned long * val, char * buf, size_t count, loff_t * offset);
90 +ssize_t oprofilefs_ulong_to_user(unsigned long val, char * buf, size_t count, loff_t * offset);
91  
92  /**
93   * Read an ASCII string for a number from a userspace buffer and fill *val on success.
94
This page took 0.040234 seconds and 3 git commands to generate.