From 2b9fb5bb61d649a2cd5045cd781ec31a9c3645ef Mon Sep 17 00:00:00 2001 From: Russell King Date: Thu, 16 Mar 2006 11:32:51 +0000 Subject: [PATCH] --- yaml --- r: 22849 b: refs/heads/master c: ae92dc9f7bc9018f1d043f102747a1f1e4dd96fb h: refs/heads/master i: 22847: 057faf7d202d02b7e5efec8ac63a8493e16afbd3 v: v3 --- [refs] | 2 +- trunk/arch/arm/oprofile/common.c | 11 +++++++++-- trunk/arch/arm/oprofile/op_counter.h | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 4052252f10c6..2245073ac6e5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 93ad79496c8831552d5f8ca7c182f149cc3cf19a +refs/heads/master: ae92dc9f7bc9018f1d043f102747a1f1e4dd96fb diff --git a/trunk/arch/arm/oprofile/common.c b/trunk/arch/arm/oprofile/common.c index b57b6d11c9fb..de72902ad0ca 100644 --- a/trunk/arch/arm/oprofile/common.c +++ b/trunk/arch/arm/oprofile/common.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -20,7 +21,7 @@ static struct op_arm_model_spec *op_arm_model; static int op_arm_enabled; static DEFINE_MUTEX(op_arm_mutex); -struct op_counter_config counter_config[OP_MAX_COUNTER]; +struct op_counter_config *counter_config; static int op_arm_create_files(struct super_block *sb, struct dentry *root) { @@ -28,7 +29,7 @@ static int op_arm_create_files(struct super_block *sb, struct dentry *root) for (i = 0; i < op_arm_model->num_counters; i++) { struct dentry *dir; - char buf[2]; + char buf[4]; snprintf(buf, sizeof buf, "%d", i); dir = oprofilefs_mkdir(sb, root, buf); @@ -139,6 +140,11 @@ int __init oprofile_arch_init(struct oprofile_operations *ops) if (ret < 0) return ret; + counter_config = kmalloc(sizeof(struct op_counter_config) * spec->num_counters, + GFP_KERNEL); + if (!counter_config) + return -ENOMEM; + op_arm_model = spec; init_driverfs(); ops->create_files = op_arm_create_files; @@ -160,4 +166,5 @@ void oprofile_arch_exit(void) exit_driverfs(); op_arm_model = NULL; } + kfree(counter_config); } diff --git a/trunk/arch/arm/oprofile/op_counter.h b/trunk/arch/arm/oprofile/op_counter.h index 153c1d467f24..8c5351d751cf 100644 --- a/trunk/arch/arm/oprofile/op_counter.h +++ b/trunk/arch/arm/oprofile/op_counter.h @@ -24,6 +24,6 @@ struct op_counter_config { unsigned long user; }; -extern struct op_counter_config counter_config[]; +extern struct op_counter_config *counter_config; #endif /* OP_COUNTER_H */