Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ef7bca14 authored by Al Viro's avatar Al Viro
Browse files

oprofile: don't bother with passing superblock to ->create_files()



Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent a9e599e5
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -106,7 +106,7 @@ op_axp_stop(void)
}

static int
op_axp_create_files(struct super_block *sb, struct dentry *root)
op_axp_create_files(struct dentry *root)
{
	int i;

@@ -115,23 +115,23 @@ op_axp_create_files(struct super_block *sb, struct dentry *root)
		char buf[4];

		snprintf(buf, sizeof buf, "%d", i);
		dir = oprofilefs_mkdir(sb, root, buf);
		dir = oprofilefs_mkdir(root->d_sb, root, buf);

		oprofilefs_create_ulong(sb, dir, "enabled", &ctr[i].enabled);
                oprofilefs_create_ulong(sb, dir, "event", &ctr[i].event);
		oprofilefs_create_ulong(sb, dir, "count", &ctr[i].count);
		oprofilefs_create_ulong(root->d_sb, dir, "enabled", &ctr[i].enabled);
                oprofilefs_create_ulong(root->d_sb, dir, "event", &ctr[i].event);
		oprofilefs_create_ulong(root->d_sb, dir, "count", &ctr[i].count);
		/* Dummies.  */
		oprofilefs_create_ulong(sb, dir, "kernel", &ctr[i].kernel);
		oprofilefs_create_ulong(sb, dir, "user", &ctr[i].user);
		oprofilefs_create_ulong(sb, dir, "unit_mask", &ctr[i].unit_mask);
		oprofilefs_create_ulong(root->d_sb, dir, "kernel", &ctr[i].kernel);
		oprofilefs_create_ulong(root->d_sb, dir, "user", &ctr[i].user);
		oprofilefs_create_ulong(root->d_sb, dir, "unit_mask", &ctr[i].unit_mask);
	}

	if (model->can_set_proc_mode) {
		oprofilefs_create_ulong(sb, root, "enable_pal",
		oprofilefs_create_ulong(root->d_sb, root, "enable_pal",
					&sys.enable_pal);
		oprofilefs_create_ulong(sb, root, "enable_kernel",
		oprofilefs_create_ulong(root->d_sb, root, "enable_kernel",
					&sys.enable_kernel);
		oprofilefs_create_ulong(sb, root, "enable_user",
		oprofilefs_create_ulong(root->d_sb, root, "enable_user",
					&sys.enable_user);
	}

+8 −9
Original line number Diff line number Diff line
@@ -97,8 +97,7 @@ static irqreturn_t avr32_perf_counter_interrupt(int irq, void *dev_id)
	return IRQ_HANDLED;
}

static int avr32_perf_counter_create_files(struct super_block *sb,
		struct dentry *root)
static int avr32_perf_counter_create_files(struct dentry *root)
{
	struct dentry *dir;
	unsigned int i;
@@ -106,21 +105,21 @@ static int avr32_perf_counter_create_files(struct super_block *sb,

	for (i = 0; i < NR_counter; i++) {
		snprintf(filename, sizeof(filename), "%u", i);
		dir = oprofilefs_mkdir(sb, root, filename);
		dir = oprofilefs_mkdir(root->d_sb, root, filename);

		oprofilefs_create_ulong(sb, dir, "enabled",
		oprofilefs_create_ulong(root->d_sb, dir, "enabled",
				&counter[i].enabled);
		oprofilefs_create_ulong(sb, dir, "event",
		oprofilefs_create_ulong(root->d_sb, dir, "event",
				&counter[i].event);
		oprofilefs_create_ulong(sb, dir, "count",
		oprofilefs_create_ulong(root->d_sb, dir, "count",
				&counter[i].count);

		/* Dummy entries */
		oprofilefs_create_ulong(sb, dir, "kernel",
		oprofilefs_create_ulong(root->d_sb, dir, "kernel",
				&counter[i].kernel);
		oprofilefs_create_ulong(sb, dir, "user",
		oprofilefs_create_ulong(root->d_sb, dir, "user",
				&counter[i].user);
		oprofilefs_create_ulong(sb, dir, "unit_mask",
		oprofilefs_create_ulong(root->d_sb, dir, "unit_mask",
				&counter[i].unit_mask);
	}

+10 −10
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ static int op_mips_setup(void)
	return 0;
}

static int op_mips_create_files(struct super_block *sb, struct dentry *root)
static int op_mips_create_files(struct dentry *root)
{
	int i;

@@ -42,16 +42,16 @@ static int op_mips_create_files(struct super_block *sb, struct dentry *root)
		char buf[4];

		snprintf(buf, sizeof buf, "%d", i);
		dir = oprofilefs_mkdir(sb, root, buf);

		oprofilefs_create_ulong(sb, dir, "enabled", &ctr[i].enabled);
		oprofilefs_create_ulong(sb, dir, "event", &ctr[i].event);
		oprofilefs_create_ulong(sb, dir, "count", &ctr[i].count);
		oprofilefs_create_ulong(sb, dir, "kernel", &ctr[i].kernel);
		oprofilefs_create_ulong(sb, dir, "user", &ctr[i].user);
		oprofilefs_create_ulong(sb, dir, "exl", &ctr[i].exl);
		dir = oprofilefs_mkdir(root->d_sb, root, buf);

		oprofilefs_create_ulong(root->d_sb, dir, "enabled", &ctr[i].enabled);
		oprofilefs_create_ulong(root->d_sb, dir, "event", &ctr[i].event);
		oprofilefs_create_ulong(root->d_sb, dir, "count", &ctr[i].count);
		oprofilefs_create_ulong(root->d_sb, dir, "kernel", &ctr[i].kernel);
		oprofilefs_create_ulong(root->d_sb, dir, "user", &ctr[i].user);
		oprofilefs_create_ulong(root->d_sb, dir, "exl", &ctr[i].exl);
		/* Dummy.  */
		oprofilefs_create_ulong(sb, dir, "unit_mask", &ctr[i].unit_mask);
		oprofilefs_create_ulong(root->d_sb, dir, "unit_mask", &ctr[i].unit_mask);
	}

	return 0;
+14 −14
Original line number Diff line number Diff line
@@ -119,7 +119,7 @@ static void op_powerpc_stop(void)
                model->global_stop();
}

static int op_powerpc_create_files(struct super_block *sb, struct dentry *root)
static int op_powerpc_create_files(struct dentry *root)
{
	int i;

@@ -128,9 +128,9 @@ static int op_powerpc_create_files(struct super_block *sb, struct dentry *root)
	 * There is one mmcr0, mmcr1 and mmcra for setting the events for
	 * all of the counters.
	 */
	oprofilefs_create_ulong(sb, root, "mmcr0", &sys.mmcr0);
	oprofilefs_create_ulong(sb, root, "mmcr1", &sys.mmcr1);
	oprofilefs_create_ulong(sb, root, "mmcra", &sys.mmcra);
	oprofilefs_create_ulong(root->d_sb, root, "mmcr0", &sys.mmcr0);
	oprofilefs_create_ulong(root->d_sb, root, "mmcr1", &sys.mmcr1);
	oprofilefs_create_ulong(root->d_sb, root, "mmcra", &sys.mmcra);
#ifdef CONFIG_OPROFILE_CELL
	/* create a file the user tool can check to see what level of profiling
	 * support exits with this kernel. Initialize bit mask to indicate
@@ -142,7 +142,7 @@ static int op_powerpc_create_files(struct super_block *sb, struct dentry *root)
	 * If the file does not exist, then the kernel only supports SPU
	 * cycle profiling, PPU event and cycle profiling.
	 */
	oprofilefs_create_ulong(sb, root, "cell_support", &sys.cell_support);
	oprofilefs_create_ulong(root->d_sb, root, "cell_support", &sys.cell_support);
	sys.cell_support = 0x1; /* Note, the user OProfile tool must check
				 * that this bit is set before attempting to
				 * user SPU event profiling.  Older kernels
@@ -160,11 +160,11 @@ static int op_powerpc_create_files(struct super_block *sb, struct dentry *root)
		char buf[4];

		snprintf(buf, sizeof buf, "%d", i);
		dir = oprofilefs_mkdir(sb, root, buf);
		dir = oprofilefs_mkdir(root->d_sb, root, buf);

		oprofilefs_create_ulong(sb, dir, "enabled", &ctr[i].enabled);
		oprofilefs_create_ulong(sb, dir, "event", &ctr[i].event);
		oprofilefs_create_ulong(sb, dir, "count", &ctr[i].count);
		oprofilefs_create_ulong(root->d_sb, dir, "enabled", &ctr[i].enabled);
		oprofilefs_create_ulong(root->d_sb, dir, "event", &ctr[i].event);
		oprofilefs_create_ulong(root->d_sb, dir, "count", &ctr[i].count);

		/*
		 * Classic PowerPC doesn't support per-counter
@@ -173,14 +173,14 @@ static int op_powerpc_create_files(struct super_block *sb, struct dentry *root)
		 * Book-E style performance monitors, we do
		 * support them.
		 */
		oprofilefs_create_ulong(sb, dir, "kernel", &ctr[i].kernel);
		oprofilefs_create_ulong(sb, dir, "user", &ctr[i].user);
		oprofilefs_create_ulong(root->d_sb, dir, "kernel", &ctr[i].kernel);
		oprofilefs_create_ulong(root->d_sb, dir, "user", &ctr[i].user);

		oprofilefs_create_ulong(sb, dir, "unit_mask", &ctr[i].unit_mask);
		oprofilefs_create_ulong(root->d_sb, dir, "unit_mask", &ctr[i].unit_mask);
	}

	oprofilefs_create_ulong(sb, root, "enable_kernel", &sys.enable_kernel);
	oprofilefs_create_ulong(sb, root, "enable_user", &sys.enable_user);
	oprofilefs_create_ulong(root->d_sb, root, "enable_kernel", &sys.enable_kernel);
	oprofilefs_create_ulong(root->d_sb, root, "enable_user", &sys.enable_user);

	/* Default to tracing both kernel and user */
	sys.enable_kernel = 1;
+17 −18
Original line number Diff line number Diff line
@@ -346,16 +346,15 @@ static const struct file_operations timer_enabled_fops = {
};


static int oprofile_create_hwsampling_files(struct super_block *sb,
					    struct dentry *root)
static int oprofile_create_hwsampling_files(struct dentry *root)
{
	struct dentry *dir;

	dir = oprofilefs_mkdir(sb, root, "timer");
	dir = oprofilefs_mkdir(root->d_sb, root, "timer");
	if (!dir)
		return -EINVAL;

	oprofilefs_create_file(sb, dir, "enabled", &timer_enabled_fops);
	oprofilefs_create_file(root->d_sb, dir, "enabled", &timer_enabled_fops);

	if (!hwsampler_available)
		return 0;
@@ -376,17 +375,17 @@ static int oprofile_create_hwsampling_files(struct super_block *sb,
		 * and can only be set to 0.
		 */

		dir = oprofilefs_mkdir(sb, root, "0");
		dir = oprofilefs_mkdir(root->d_sb, root, "0");
		if (!dir)
			return -EINVAL;

		oprofilefs_create_file(sb, dir, "enabled", &hwsampler_fops);
		oprofilefs_create_file(sb, dir, "event", &zero_fops);
		oprofilefs_create_file(sb, dir, "count", &hw_interval_fops);
		oprofilefs_create_file(sb, dir, "unit_mask", &zero_fops);
		oprofilefs_create_file(sb, dir, "kernel", &kernel_fops);
		oprofilefs_create_file(sb, dir, "user", &user_fops);
		oprofilefs_create_ulong(sb, dir, "hw_sdbt_blocks",
		oprofilefs_create_file(root->d_sb, dir, "enabled", &hwsampler_fops);
		oprofilefs_create_file(root->d_sb, dir, "event", &zero_fops);
		oprofilefs_create_file(root->d_sb, dir, "count", &hw_interval_fops);
		oprofilefs_create_file(root->d_sb, dir, "unit_mask", &zero_fops);
		oprofilefs_create_file(root->d_sb, dir, "kernel", &kernel_fops);
		oprofilefs_create_file(root->d_sb, dir, "user", &user_fops);
		oprofilefs_create_ulong(root->d_sb, dir, "hw_sdbt_blocks",
					&oprofile_sdbt_blocks);

	} else {
@@ -396,19 +395,19 @@ static int oprofile_create_hwsampling_files(struct super_block *sb,
		 * space tools.  The /dev/oprofile/hwsampling fs is
		 * provided in that case.
		 */
		dir = oprofilefs_mkdir(sb, root, "hwsampling");
		dir = oprofilefs_mkdir(root->d_sb, root, "hwsampling");
		if (!dir)
			return -EINVAL;

		oprofilefs_create_file(sb, dir, "hwsampler",
		oprofilefs_create_file(root->d_sb, dir, "hwsampler",
				       &hwsampler_fops);
		oprofilefs_create_file(sb, dir, "hw_interval",
		oprofilefs_create_file(root->d_sb, dir, "hw_interval",
				       &hw_interval_fops);
		oprofilefs_create_ro_ulong(sb, dir, "hw_min_interval",
		oprofilefs_create_ro_ulong(root->d_sb, dir, "hw_min_interval",
					   &oprofile_min_interval);
		oprofilefs_create_ro_ulong(sb, dir, "hw_max_interval",
		oprofilefs_create_ro_ulong(root->d_sb, dir, "hw_max_interval",
					   &oprofile_max_interval);
		oprofilefs_create_ulong(sb, dir, "hw_sdbt_blocks",
		oprofilefs_create_ulong(root->d_sb, dir, "hw_sdbt_blocks",
					&oprofile_sdbt_blocks);
	}
	return 0;
Loading