aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/s390/appldata/appldata.h10
-rw-r--r--arch/s390/appldata/appldata_base.c39
-rw-r--r--arch/s390/appldata/appldata_mem.c43
-rw-r--r--arch/s390/appldata/appldata_net_sum.c39
-rw-r--r--arch/s390/appldata/appldata_os.c57
5 files changed, 11 insertions, 177 deletions
diff --git a/arch/s390/appldata/appldata.h b/arch/s390/appldata/appldata.h
index db3ae8505103..17a2636fec0a 100644
--- a/arch/s390/appldata/appldata.h
+++ b/arch/s390/appldata/appldata.h
@@ -3,13 +3,11 @@
3 * 3 *
4 * Definitions and interface for Linux - z/VM Monitor Stream. 4 * Definitions and interface for Linux - z/VM Monitor Stream.
5 * 5 *
6 * Copyright (C) 2003,2006 IBM Corporation, IBM Deutschland Entwicklung GmbH. 6 * Copyright IBM Corp. 2003, 2008
7 * 7 *
8 * Author: Gerald Schaefer <gerald.schaefer@de.ibm.com> 8 * Author: Gerald Schaefer <gerald.schaefer@de.ibm.com>
9 */ 9 */
10 10
11//#define APPLDATA_DEBUG /* Debug messages on/off */
12
13#define APPLDATA_MAX_REC_SIZE 4024 /* Maximum size of the */ 11#define APPLDATA_MAX_REC_SIZE 4024 /* Maximum size of the */
14 /* data buffer */ 12 /* data buffer */
15#define APPLDATA_MAX_PROCS 100 13#define APPLDATA_MAX_PROCS 100
@@ -32,12 +30,6 @@
32#define P_ERROR(x...) printk(KERN_ERR MY_PRINT_NAME " error: " x) 30#define P_ERROR(x...) printk(KERN_ERR MY_PRINT_NAME " error: " x)
33#define P_WARNING(x...) printk(KERN_WARNING MY_PRINT_NAME " status: " x) 31#define P_WARNING(x...) printk(KERN_WARNING MY_PRINT_NAME " status: " x)
34 32
35#ifdef APPLDATA_DEBUG
36#define P_DEBUG(x...) printk(KERN_DEBUG MY_PRINT_NAME " debug: " x)
37#else
38#define P_DEBUG(x...) do {} while (0)
39#endif
40
41struct appldata_ops { 33struct appldata_ops {
42 struct list_head list; 34 struct list_head list;
43 struct ctl_table_header *sysctl_header; 35 struct ctl_table_header *sysctl_header;
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c
index 803f3645edf6..9cb3d92447a3 100644
--- a/arch/s390/appldata/appldata_base.c
+++ b/arch/s390/appldata/appldata_base.c
@@ -5,7 +5,7 @@
5 * Exports appldata_register_ops() and appldata_unregister_ops() for the 5 * Exports appldata_register_ops() and appldata_unregister_ops() for the
6 * data gathering modules. 6 * data gathering modules.
7 * 7 *
8 * Copyright (C) 2003,2006 IBM Corporation, IBM Deutschland Entwicklung GmbH. 8 * Copyright IBM Corp. 2003, 2008
9 * 9 *
10 * Author: Gerald Schaefer <gerald.schaefer@de.ibm.com> 10 * Author: Gerald Schaefer <gerald.schaefer@de.ibm.com>
11 */ 11 */
@@ -108,9 +108,6 @@ static LIST_HEAD(appldata_ops_list);
108 */ 108 */
109static void appldata_timer_function(unsigned long data) 109static void appldata_timer_function(unsigned long data)
110{ 110{
111 P_DEBUG(" -= Timer =-\n");
112 P_DEBUG("CPU: %i, expire_count: %i\n", smp_processor_id(),
113 atomic_read(&appldata_expire_count));
114 if (atomic_dec_and_test(&appldata_expire_count)) { 111 if (atomic_dec_and_test(&appldata_expire_count)) {
115 atomic_set(&appldata_expire_count, num_online_cpus()); 112 atomic_set(&appldata_expire_count, num_online_cpus());
116 queue_work(appldata_wq, (struct work_struct *) data); 113 queue_work(appldata_wq, (struct work_struct *) data);
@@ -128,14 +125,11 @@ static void appldata_work_fn(struct work_struct *work)
128 struct appldata_ops *ops; 125 struct appldata_ops *ops;
129 int i; 126 int i;
130 127
131 P_DEBUG(" -= Work Queue =-\n");
132 i = 0; 128 i = 0;
133 get_online_cpus(); 129 get_online_cpus();
134 spin_lock(&appldata_ops_lock); 130 spin_lock(&appldata_ops_lock);
135 list_for_each(lh, &appldata_ops_list) { 131 list_for_each(lh, &appldata_ops_list) {
136 ops = list_entry(lh, struct appldata_ops, list); 132 ops = list_entry(lh, struct appldata_ops, list);
137 P_DEBUG("list_for_each loop: %i) active = %u, name = %s\n",
138 ++i, ops->active, ops->name);
139 if (ops->active == 1) { 133 if (ops->active == 1) {
140 ops->callback(ops->data); 134 ops->callback(ops->data);
141 } 135 }
@@ -212,7 +206,6 @@ __appldata_vtimer_setup(int cmd)
212 0, 1); 206 0, 1);
213 } 207 }
214 appldata_timer_active = 1; 208 appldata_timer_active = 1;
215 P_INFO("Monitoring timer started.\n");
216 break; 209 break;
217 case APPLDATA_DEL_TIMER: 210 case APPLDATA_DEL_TIMER:
218 for_each_online_cpu(i) 211 for_each_online_cpu(i)
@@ -221,7 +214,6 @@ __appldata_vtimer_setup(int cmd)
221 break; 214 break;
222 appldata_timer_active = 0; 215 appldata_timer_active = 0;
223 atomic_set(&appldata_expire_count, num_online_cpus()); 216 atomic_set(&appldata_expire_count, num_online_cpus());
224 P_INFO("Monitoring timer stopped.\n");
225 break; 217 break;
226 case APPLDATA_MOD_TIMER: 218 case APPLDATA_MOD_TIMER:
227 per_cpu_interval = (u64) (appldata_interval*1000 / 219 per_cpu_interval = (u64) (appldata_interval*1000 /
@@ -313,10 +305,8 @@ appldata_interval_handler(ctl_table *ctl, int write, struct file *filp,
313 } 305 }
314 interval = 0; 306 interval = 0;
315 sscanf(buf, "%i", &interval); 307 sscanf(buf, "%i", &interval);
316 if (interval <= 0) { 308 if (interval <= 0)
317 P_ERROR("Timer CPU interval has to be > 0!\n");
318 return -EINVAL; 309 return -EINVAL;
319 }
320 310
321 get_online_cpus(); 311 get_online_cpus();
322 spin_lock(&appldata_timer_lock); 312 spin_lock(&appldata_timer_lock);
@@ -324,9 +314,6 @@ appldata_interval_handler(ctl_table *ctl, int write, struct file *filp,
324 __appldata_vtimer_setup(APPLDATA_MOD_TIMER); 314 __appldata_vtimer_setup(APPLDATA_MOD_TIMER);
325 spin_unlock(&appldata_timer_lock); 315 spin_unlock(&appldata_timer_lock);
326 put_online_cpus(); 316 put_online_cpus();
327
328 P_INFO("Monitoring CPU interval set to %u milliseconds.\n",
329 interval);
330out: 317out:
331 *lenp = len; 318 *lenp = len;
332 *ppos += len; 319 *ppos += len;
@@ -406,23 +393,16 @@ appldata_generic_handler(ctl_table *ctl, int write, struct file *filp,
406 P_ERROR("START DIAG 0xDC for %s failed, " 393 P_ERROR("START DIAG 0xDC for %s failed, "
407 "return code: %d\n", ops->name, rc); 394 "return code: %d\n", ops->name, rc);
408 module_put(ops->owner); 395 module_put(ops->owner);
409 } else { 396 } else
410 P_INFO("Monitoring %s data enabled, "
411 "DIAG 0xDC started.\n", ops->name);
412 ops->active = 1; 397 ops->active = 1;
413 }
414 } else if ((buf[0] == '0') && (ops->active == 1)) { 398 } else if ((buf[0] == '0') && (ops->active == 1)) {
415 ops->active = 0; 399 ops->active = 0;
416 rc = appldata_diag(ops->record_nr, APPLDATA_STOP_REC, 400 rc = appldata_diag(ops->record_nr, APPLDATA_STOP_REC,
417 (unsigned long) ops->data, ops->size, 401 (unsigned long) ops->data, ops->size,
418 ops->mod_lvl); 402 ops->mod_lvl);
419 if (rc != 0) { 403 if (rc != 0)
420 P_ERROR("STOP DIAG 0xDC for %s failed, " 404 P_ERROR("STOP DIAG 0xDC for %s failed, "
421 "return code: %d\n", ops->name, rc); 405 "return code: %d\n", ops->name, rc);
422 } else {
423 P_INFO("Monitoring %s data disabled, "
424 "DIAG 0xDC stopped.\n", ops->name);
425 }
426 module_put(ops->owner); 406 module_put(ops->owner);
427 } 407 }
428 spin_unlock(&appldata_ops_lock); 408 spin_unlock(&appldata_ops_lock);
@@ -468,7 +448,6 @@ int appldata_register_ops(struct appldata_ops *ops)
468 ops->sysctl_header = register_sysctl_table(ops->ctl_table); 448 ops->sysctl_header = register_sysctl_table(ops->ctl_table);
469 if (!ops->sysctl_header) 449 if (!ops->sysctl_header)
470 goto out; 450 goto out;
471 P_INFO("%s-ops registered!\n", ops->name);
472 return 0; 451 return 0;
473out: 452out:
474 spin_lock(&appldata_ops_lock); 453 spin_lock(&appldata_ops_lock);
@@ -490,7 +469,6 @@ void appldata_unregister_ops(struct appldata_ops *ops)
490 spin_unlock(&appldata_ops_lock); 469 spin_unlock(&appldata_ops_lock);
491 unregister_sysctl_table(ops->sysctl_header); 470 unregister_sysctl_table(ops->sysctl_header);
492 kfree(ops->ctl_table); 471 kfree(ops->ctl_table);
493 P_INFO("%s-ops unregistered!\n", ops->name);
494} 472}
495/********************** module-ops management <END> **************************/ 473/********************** module-ops management <END> **************************/
496 474
@@ -553,14 +531,9 @@ static int __init appldata_init(void)
553{ 531{
554 int i; 532 int i;
555 533
556 P_DEBUG("sizeof(parameter_list) = %lu\n",
557 sizeof(struct appldata_parameter_list));
558
559 appldata_wq = create_singlethread_workqueue("appldata"); 534 appldata_wq = create_singlethread_workqueue("appldata");
560 if (!appldata_wq) { 535 if (!appldata_wq)
561 P_ERROR("Could not create work queue\n");
562 return -ENOMEM; 536 return -ENOMEM;
563 }
564 537
565 get_online_cpus(); 538 get_online_cpus();
566 for_each_online_cpu(i) 539 for_each_online_cpu(i)
@@ -571,8 +544,6 @@ static int __init appldata_init(void)
571 register_hotcpu_notifier(&appldata_nb); 544 register_hotcpu_notifier(&appldata_nb);
572 545
573 appldata_sysctl_header = register_sysctl_table(appldata_dir_table); 546 appldata_sysctl_header = register_sysctl_table(appldata_dir_table);
574
575 P_DEBUG("Base interface initialized.\n");
576 return 0; 547 return 0;
577} 548}
578 549
diff --git a/arch/s390/appldata/appldata_mem.c b/arch/s390/appldata/appldata_mem.c
index 51181ccdb87b..3ed56b7d1b2f 100644
--- a/arch/s390/appldata/appldata_mem.c
+++ b/arch/s390/appldata/appldata_mem.c
@@ -14,14 +14,13 @@
14#include <linux/slab.h> 14#include <linux/slab.h>
15#include <linux/errno.h> 15#include <linux/errno.h>
16#include <linux/kernel_stat.h> 16#include <linux/kernel_stat.h>
17#include <asm/io.h>
18#include <linux/pagemap.h> 17#include <linux/pagemap.h>
19#include <linux/swap.h> 18#include <linux/swap.h>
19#include <asm/io.h>
20 20
21#include "appldata.h" 21#include "appldata.h"
22 22
23 23
24#define MY_PRINT_NAME "appldata_mem" /* for debug messages, etc. */
25#define P2K(x) ((x) << (PAGE_SHIFT - 10)) /* Converts #Pages to KB */ 24#define P2K(x) ((x) << (PAGE_SHIFT - 10)) /* Converts #Pages to KB */
26 25
27/* 26/*
@@ -70,30 +69,6 @@ static struct appldata_mem_data {
70} __attribute__((packed)) appldata_mem_data; 69} __attribute__((packed)) appldata_mem_data;
71 70
72 71
73static inline void appldata_debug_print(struct appldata_mem_data *mem_data)
74{
75 P_DEBUG("--- MEM - RECORD ---\n");
76 P_DEBUG("pgpgin = %8lu KB\n", mem_data->pgpgin);
77 P_DEBUG("pgpgout = %8lu KB\n", mem_data->pgpgout);
78 P_DEBUG("pswpin = %8lu Pages\n", mem_data->pswpin);
79 P_DEBUG("pswpout = %8lu Pages\n", mem_data->pswpout);
80 P_DEBUG("pgalloc = %8lu \n", mem_data->pgalloc);
81 P_DEBUG("pgfault = %8lu \n", mem_data->pgfault);
82 P_DEBUG("pgmajfault = %8lu \n", mem_data->pgmajfault);
83 P_DEBUG("sharedram = %8lu KB\n", mem_data->sharedram);
84 P_DEBUG("totalram = %8lu KB\n", mem_data->totalram);
85 P_DEBUG("freeram = %8lu KB\n", mem_data->freeram);
86 P_DEBUG("totalhigh = %8lu KB\n", mem_data->totalhigh);
87 P_DEBUG("freehigh = %8lu KB\n", mem_data->freehigh);
88 P_DEBUG("bufferram = %8lu KB\n", mem_data->bufferram);
89 P_DEBUG("cached = %8lu KB\n", mem_data->cached);
90 P_DEBUG("totalswap = %8lu KB\n", mem_data->totalswap);
91 P_DEBUG("freeswap = %8lu KB\n", mem_data->freeswap);
92 P_DEBUG("sync_count_1 = %u\n", mem_data->sync_count_1);
93 P_DEBUG("sync_count_2 = %u\n", mem_data->sync_count_2);
94 P_DEBUG("timestamp = %lX\n", mem_data->timestamp);
95}
96
97/* 72/*
98 * appldata_get_mem_data() 73 * appldata_get_mem_data()
99 * 74 *
@@ -140,9 +115,6 @@ static void appldata_get_mem_data(void *data)
140 115
141 mem_data->timestamp = get_clock(); 116 mem_data->timestamp = get_clock();
142 mem_data->sync_count_2++; 117 mem_data->sync_count_2++;
143#ifdef APPLDATA_DEBUG
144 appldata_debug_print(mem_data);
145#endif
146} 118}
147 119
148 120
@@ -164,17 +136,7 @@ static struct appldata_ops ops = {
164 */ 136 */
165static int __init appldata_mem_init(void) 137static int __init appldata_mem_init(void)
166{ 138{
167 int rc; 139 return appldata_register_ops(&ops);
168
169 P_DEBUG("sizeof(mem) = %lu\n", sizeof(struct appldata_mem_data));
170
171 rc = appldata_register_ops(&ops);
172 if (rc != 0) {
173 P_ERROR("Error registering ops, rc = %i\n", rc);
174 } else {
175 P_DEBUG("%s-ops registered!\n", ops.name);
176 }
177 return rc;
178} 140}
179 141
180/* 142/*
@@ -185,7 +147,6 @@ static int __init appldata_mem_init(void)
185static void __exit appldata_mem_exit(void) 147static void __exit appldata_mem_exit(void)
186{ 148{
187 appldata_unregister_ops(&ops); 149 appldata_unregister_ops(&ops);
188 P_DEBUG("%s-ops unregistered!\n", ops.name);
189} 150}
190 151
191 152
diff --git a/arch/s390/appldata/appldata_net_sum.c b/arch/s390/appldata/appldata_net_sum.c
index 4d8344336001..3b746556e1a3 100644
--- a/arch/s390/appldata/appldata_net_sum.c
+++ b/arch/s390/appldata/appldata_net_sum.c
@@ -21,9 +21,6 @@
21#include "appldata.h" 21#include "appldata.h"
22 22
23 23
24#define MY_PRINT_NAME "appldata_net_sum" /* for debug messages, etc. */
25
26
27/* 24/*
28 * Network data 25 * Network data
29 * 26 *
@@ -60,26 +57,6 @@ static struct appldata_net_sum_data {
60} __attribute__((packed)) appldata_net_sum_data; 57} __attribute__((packed)) appldata_net_sum_data;
61 58
62 59
63static inline void appldata_print_debug(struct appldata_net_sum_data *net_data)
64{
65 P_DEBUG("--- NET - RECORD ---\n");
66
67 P_DEBUG("nr_interfaces = %u\n", net_data->nr_interfaces);
68 P_DEBUG("rx_packets = %8lu\n", net_data->rx_packets);
69 P_DEBUG("tx_packets = %8lu\n", net_data->tx_packets);
70 P_DEBUG("rx_bytes = %8lu\n", net_data->rx_bytes);
71 P_DEBUG("tx_bytes = %8lu\n", net_data->tx_bytes);
72 P_DEBUG("rx_errors = %8lu\n", net_data->rx_errors);
73 P_DEBUG("tx_errors = %8lu\n", net_data->tx_errors);
74 P_DEBUG("rx_dropped = %8lu\n", net_data->rx_dropped);
75 P_DEBUG("tx_dropped = %8lu\n", net_data->tx_dropped);
76 P_DEBUG("collisions = %8lu\n", net_data->collisions);
77
78 P_DEBUG("sync_count_1 = %u\n", net_data->sync_count_1);
79 P_DEBUG("sync_count_2 = %u\n", net_data->sync_count_2);
80 P_DEBUG("timestamp = %lX\n", net_data->timestamp);
81}
82
83/* 60/*
84 * appldata_get_net_sum_data() 61 * appldata_get_net_sum_data()
85 * 62 *
@@ -135,9 +112,6 @@ static void appldata_get_net_sum_data(void *data)
135 112
136 net_data->timestamp = get_clock(); 113 net_data->timestamp = get_clock();
137 net_data->sync_count_2++; 114 net_data->sync_count_2++;
138#ifdef APPLDATA_DEBUG
139 appldata_print_debug(net_data);
140#endif
141} 115}
142 116
143 117
@@ -159,17 +133,7 @@ static struct appldata_ops ops = {
159 */ 133 */
160static int __init appldata_net_init(void) 134static int __init appldata_net_init(void)
161{ 135{
162 int rc; 136 return appldata_register_ops(&ops);
163
164 P_DEBUG("sizeof(net) = %lu\n", sizeof(struct appldata_net_sum_data));
165
166 rc = appldata_register_ops(&ops);
167 if (rc != 0) {
168 P_ERROR("Error registering ops, rc = %i\n", rc);
169 } else {
170 P_DEBUG("%s-ops registered!\n", ops.name);
171 }
172 return rc;
173} 137}
174 138
175/* 139/*
@@ -180,7 +144,6 @@ static int __init appldata_net_init(void)
180static void __exit appldata_net_exit(void) 144static void __exit appldata_net_exit(void)
181{ 145{
182 appldata_unregister_ops(&ops); 146 appldata_unregister_ops(&ops);
183 P_DEBUG("%s-ops unregistered!\n", ops.name);
184} 147}
185 148
186 149
diff --git a/arch/s390/appldata/appldata_os.c b/arch/s390/appldata/appldata_os.c
index 6b3eafe10453..eb44f9f8ab91 100644
--- a/arch/s390/appldata/appldata_os.c
+++ b/arch/s390/appldata/appldata_os.c
@@ -89,44 +89,6 @@ static struct appldata_ops ops = {
89}; 89};
90 90
91 91
92static inline void appldata_print_debug(struct appldata_os_data *os_data)
93{
94 int a0, a1, a2, i;
95
96 P_DEBUG("--- OS - RECORD ---\n");
97 P_DEBUG("nr_threads = %u\n", os_data->nr_threads);
98 P_DEBUG("nr_running = %u\n", os_data->nr_running);
99 P_DEBUG("nr_iowait = %u\n", os_data->nr_iowait);
100 P_DEBUG("avenrun(int) = %8x / %8x / %8x\n", os_data->avenrun[0],
101 os_data->avenrun[1], os_data->avenrun[2]);
102 a0 = os_data->avenrun[0];
103 a1 = os_data->avenrun[1];
104 a2 = os_data->avenrun[2];
105 P_DEBUG("avenrun(float) = %d.%02d / %d.%02d / %d.%02d\n",
106 LOAD_INT(a0), LOAD_FRAC(a0), LOAD_INT(a1), LOAD_FRAC(a1),
107 LOAD_INT(a2), LOAD_FRAC(a2));
108
109 P_DEBUG("nr_cpus = %u\n", os_data->nr_cpus);
110 for (i = 0; i < os_data->nr_cpus; i++) {
111 P_DEBUG("cpu%u : user = %u, nice = %u, system = %u, "
112 "idle = %u, irq = %u, softirq = %u, iowait = %u, "
113 "steal = %u\n",
114 os_data->os_cpu[i].cpu_id,
115 os_data->os_cpu[i].per_cpu_user,
116 os_data->os_cpu[i].per_cpu_nice,
117 os_data->os_cpu[i].per_cpu_system,
118 os_data->os_cpu[i].per_cpu_idle,
119 os_data->os_cpu[i].per_cpu_irq,
120 os_data->os_cpu[i].per_cpu_softirq,
121 os_data->os_cpu[i].per_cpu_iowait,
122 os_data->os_cpu[i].per_cpu_steal);
123 }
124
125 P_DEBUG("sync_count_1 = %u\n", os_data->sync_count_1);
126 P_DEBUG("sync_count_2 = %u\n", os_data->sync_count_2);
127 P_DEBUG("timestamp = %lX\n", os_data->timestamp);
128}
129
130/* 92/*
131 * appldata_get_os_data() 93 * appldata_get_os_data()
132 * 94 *
@@ -180,13 +142,10 @@ static void appldata_get_os_data(void *data)
180 APPLDATA_START_INTERVAL_REC, 142 APPLDATA_START_INTERVAL_REC,
181 (unsigned long) ops.data, new_size, 143 (unsigned long) ops.data, new_size,
182 ops.mod_lvl); 144 ops.mod_lvl);
183 if (rc != 0) { 145 if (rc != 0)
184 P_ERROR("os: START NEW DIAG 0xDC failed, " 146 P_ERROR("os: START NEW DIAG 0xDC failed, "
185 "return code: %d, new size = %i\n", rc, 147 "return code: %d, new size = %i\n", rc,
186 new_size); 148 new_size);
187 P_INFO("os: stopping old record now\n");
188 } else
189 P_INFO("os: new record size = %i\n", new_size);
190 149
191 rc = appldata_diag(APPLDATA_RECORD_OS_ID, 150 rc = appldata_diag(APPLDATA_RECORD_OS_ID,
192 APPLDATA_STOP_REC, 151 APPLDATA_STOP_REC,
@@ -204,9 +163,6 @@ static void appldata_get_os_data(void *data)
204 } 163 }
205 os_data->timestamp = get_clock(); 164 os_data->timestamp = get_clock();
206 os_data->sync_count_2++; 165 os_data->sync_count_2++;
207#ifdef APPLDATA_DEBUG
208 appldata_print_debug(os_data);
209#endif
210} 166}
211 167
212 168
@@ -227,12 +183,9 @@ static int __init appldata_os_init(void)
227 rc = -ENOMEM; 183 rc = -ENOMEM;
228 goto out; 184 goto out;
229 } 185 }
230 P_DEBUG("max. sizeof(os) = %i, sizeof(os_cpu) = %lu\n", max_size,
231 sizeof(struct appldata_os_per_cpu));
232 186
233 appldata_os_data = kzalloc(max_size, GFP_DMA); 187 appldata_os_data = kzalloc(max_size, GFP_DMA);
234 if (appldata_os_data == NULL) { 188 if (appldata_os_data == NULL) {
235 P_ERROR("No memory for %s!\n", ops.name);
236 rc = -ENOMEM; 189 rc = -ENOMEM;
237 goto out; 190 goto out;
238 } 191 }
@@ -240,17 +193,12 @@ static int __init appldata_os_init(void)
240 appldata_os_data->per_cpu_size = sizeof(struct appldata_os_per_cpu); 193 appldata_os_data->per_cpu_size = sizeof(struct appldata_os_per_cpu);
241 appldata_os_data->cpu_offset = offsetof(struct appldata_os_data, 194 appldata_os_data->cpu_offset = offsetof(struct appldata_os_data,
242 os_cpu); 195 os_cpu);
243 P_DEBUG("cpu offset = %u\n", appldata_os_data->cpu_offset);
244 196
245 ops.data = appldata_os_data; 197 ops.data = appldata_os_data;
246 ops.callback = &appldata_get_os_data; 198 ops.callback = &appldata_get_os_data;
247 rc = appldata_register_ops(&ops); 199 rc = appldata_register_ops(&ops);
248 if (rc != 0) { 200 if (rc != 0)
249 P_ERROR("Error registering ops, rc = %i\n", rc);
250 kfree(appldata_os_data); 201 kfree(appldata_os_data);
251 } else {
252 P_DEBUG("%s-ops registered!\n", ops.name);
253 }
254out: 202out:
255 return rc; 203 return rc;
256} 204}
@@ -264,7 +212,6 @@ static void __exit appldata_os_exit(void)
264{ 212{
265 appldata_unregister_ops(&ops); 213 appldata_unregister_ops(&ops);
266 kfree(appldata_os_data); 214 kfree(appldata_os_data);
267 P_DEBUG("%s-ops unregistered!\n", ops.name);
268} 215}
269 216
270 217