Re: [PATCH 08/10] oprofile: set values to default when creatingoprofilefs

From: Robert Richter
Date: Tue Dec 16 2008 - 06:57:21 EST


On 16.12.08 01:32:25, Andrew Morton wrote:
> > +unsigned long fs_buffer_size;
> > +unsigned long fs_cpu_buffer_size;
> > +unsigned long fs_buffer_watershed;
>
> These were poorly chosen kernel-wide identifiers.

Right, didn't notice that. Will change this.

> > static ssize_t depth_read(struct file *file, char __user *buf, size_t count, loff_t *offset)
> > {
> > @@ -120,6 +124,11 @@ static const struct file_operations dump_fops = {
> >
> > void oprofile_create_files(struct super_block *sb, struct dentry *root)
> > {
> > + /* reinitialize default values */
> > + fs_buffer_size = FS_BUFFER_SIZE_DEFAULT;
> > + fs_cpu_buffer_size = FS_CPU_BUFFER_SIZE_DEFAULT;
> > + fs_buffer_watershed = FS_BUFFER_WATERSHED_DEFAULT;
> > +
> > oprofilefs_create_file(sb, root, "enable", &enable_fops);
> > oprofilefs_create_file_perm(sb, root, "dump", &dump_fops, 0666);
> > oprofilefs_create_file(sb, root, "buffer", &event_buffer_fops);
>
> afacit oprofile_create_files() only gets run when the module is loaded,
> so this patch is a no-op?

This code runs when oprofilefs is mounted. This happens typically in
an opcontrol --init/--deinit sequence. Before, the previous values
would have been used after mounting again. Now, default values are
restored.

-Robert

--
Advanced Micro Devices, Inc.
Operating System Research Center
email: robert.richter@xxxxxxx

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/