Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
X
xcap-capability-linux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
xcap
xcap-capability-linux
Commits
ae92dc9f
Commit
ae92dc9f
authored
19 years ago
by
Russell King
Committed by
Russell King
19 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[ARM] Oprofile: dynamically allocate counter_config
Signed-off-by:
Russell King
<
rmk+kernel@arm.linux.org.uk
>
parent
93ad7949
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
arch/arm/oprofile/common.c
+9
-2
9 additions, 2 deletions
arch/arm/oprofile/common.c
arch/arm/oprofile/op_counter.h
+1
-1
1 addition, 1 deletion
arch/arm/oprofile/op_counter.h
with
10 additions
and
3 deletions
arch/arm/oprofile/common.c
+
9
−
2
View file @
ae92dc9f
...
...
@@ -10,6 +10,7 @@
#include
<linux/init.h>
#include
<linux/oprofile.h>
#include
<linux/errno.h>
#include
<linux/slab.h>
#include
<linux/sysdev.h>
#include
<linux/mutex.h>
...
...
@@ -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
);
}
This diff is collapsed.
Click to expand it.
arch/arm/oprofile/op_counter.h
+
1
−
1
View file @
ae92dc9f
...
...
@@ -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 */
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment