sysfs: samples of snooping ops
This commit is contained in:
@ -11,6 +11,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
|
#include <linux/slab.h>
|
||||||
#include "mcctrl.h"
|
#include "mcctrl.h"
|
||||||
#include "sysfs_msg.h"
|
#include "sysfs_msg.h"
|
||||||
|
|
||||||
@ -30,6 +31,62 @@ struct sysfsm_ops show_int_ops = {
|
|||||||
.show = &show_int,
|
.show = &show_int,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void setup_local_snooping_samples(ihk_os_t os)
|
||||||
|
{
|
||||||
|
static long lvalue = 0xf123456789abcde0;
|
||||||
|
static char *svalue = "string(local)";
|
||||||
|
int error;
|
||||||
|
struct sysfsm_bitmap_param param;
|
||||||
|
|
||||||
|
error = sysfsm_createf(os, SYSFS_SNOOPING_OPS_d32, &lvalue, 0444, "/sys/test/local/d32");
|
||||||
|
if (error) {
|
||||||
|
panic("setup_local_snooping_samples: d32");
|
||||||
|
}
|
||||||
|
|
||||||
|
error = sysfsm_createf(os, SYSFS_SNOOPING_OPS_d64, &lvalue, 0444, "/sys/test/local/d64");
|
||||||
|
if (error) {
|
||||||
|
panic("setup_local_snooping_samples: d64");
|
||||||
|
}
|
||||||
|
|
||||||
|
error = sysfsm_createf(os, SYSFS_SNOOPING_OPS_u32, &lvalue, 0444, "/sys/test/local/u32");
|
||||||
|
if (error) {
|
||||||
|
panic("setup_local_snooping_samples: u32");
|
||||||
|
}
|
||||||
|
|
||||||
|
error = sysfsm_createf(os, SYSFS_SNOOPING_OPS_u64, &lvalue, 0444, "/sys/test/local/u64");
|
||||||
|
if (error) {
|
||||||
|
panic("setup_local_snooping_samples: u64");
|
||||||
|
}
|
||||||
|
|
||||||
|
error = sysfsm_createf(os, SYSFS_SNOOPING_OPS_s, svalue, 0444, "/sys/test/local/s");
|
||||||
|
if (error) {
|
||||||
|
panic("setup_local_snooping_samples: s");
|
||||||
|
}
|
||||||
|
|
||||||
|
param.nbits = 40;
|
||||||
|
param.ptr = &lvalue;
|
||||||
|
|
||||||
|
error = sysfsm_createf(os, SYSFS_SNOOPING_OPS_pbl, ¶m, 0444, "/sys/test/local/pbl");
|
||||||
|
if (error) {
|
||||||
|
panic("setup_local_snooping_samples: pbl");
|
||||||
|
}
|
||||||
|
|
||||||
|
param.nbits = 40;
|
||||||
|
param.ptr = &lvalue;
|
||||||
|
|
||||||
|
error = sysfsm_createf(os, SYSFS_SNOOPING_OPS_pb, ¶m, 0444, "/sys/test/local/pb");
|
||||||
|
if (error) {
|
||||||
|
panic("setup_local_snooping_samples: pb");
|
||||||
|
}
|
||||||
|
|
||||||
|
error = sysfsm_createf(os, SYSFS_SNOOPING_OPS_u32K, &lvalue, 0444, "/sys/test/local/u32K");
|
||||||
|
if (error) {
|
||||||
|
panic("setup_local_snooping_samples: u32K");
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
void setup_sysfs_files(ihk_os_t os)
|
void setup_sysfs_files(ihk_os_t os)
|
||||||
{
|
{
|
||||||
static int a_value = 35;
|
static int a_value = 35;
|
||||||
@ -62,6 +119,7 @@ void setup_sysfs_files(ihk_os_t os)
|
|||||||
panic("sysfsm_unlinkf");
|
panic("sysfsm_unlinkf");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setup_local_snooping_samples(os);
|
||||||
return;
|
return;
|
||||||
} /* setup_files() */
|
} /* setup_files() */
|
||||||
|
|
||||||
|
|||||||
@ -251,9 +251,66 @@ static void rest_init(void)
|
|||||||
sched_init();
|
sched_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void setup_remote_snooping_samples(void)
|
||||||
|
{
|
||||||
|
static long lvalue = 0xf123456789abcde0;
|
||||||
|
static char *svalue = "string(remote)";
|
||||||
|
int error;
|
||||||
|
struct sysfs_bitmap_param param;
|
||||||
|
|
||||||
|
error = sysfs_createf(SYSFS_SNOOPING_OPS_d32, &lvalue, 0444, "/sys/test/remote/d32");
|
||||||
|
if (error) {
|
||||||
|
panic("setup_remote_snooping_samples: d32");
|
||||||
|
}
|
||||||
|
|
||||||
|
error = sysfs_createf(SYSFS_SNOOPING_OPS_d64, &lvalue, 0444, "/sys/test/remote/d64");
|
||||||
|
if (error) {
|
||||||
|
panic("setup_remote_snooping_samples: d64");
|
||||||
|
}
|
||||||
|
|
||||||
|
error = sysfs_createf(SYSFS_SNOOPING_OPS_u32, &lvalue, 0444, "/sys/test/remote/u32");
|
||||||
|
if (error) {
|
||||||
|
panic("setup_remote_snooping_samples: u32");
|
||||||
|
}
|
||||||
|
|
||||||
|
error = sysfs_createf(SYSFS_SNOOPING_OPS_u64, &lvalue, 0444, "/sys/test/remote/u64");
|
||||||
|
if (error) {
|
||||||
|
panic("setup_remote_snooping_samples: u64");
|
||||||
|
}
|
||||||
|
|
||||||
|
error = sysfs_createf(SYSFS_SNOOPING_OPS_s, svalue, 0444, "/sys/test/remote/s");
|
||||||
|
if (error) {
|
||||||
|
panic("setup_remote_snooping_samples: s");
|
||||||
|
}
|
||||||
|
|
||||||
|
param.nbits = 40;
|
||||||
|
param.ptr = &lvalue;
|
||||||
|
|
||||||
|
error = sysfs_createf(SYSFS_SNOOPING_OPS_pbl, ¶m, 0444, "/sys/test/remote/pbl");
|
||||||
|
if (error) {
|
||||||
|
panic("setup_remote_snooping_samples: pbl");
|
||||||
|
}
|
||||||
|
|
||||||
|
param.nbits = 40;
|
||||||
|
param.ptr = &lvalue;
|
||||||
|
|
||||||
|
error = sysfs_createf(SYSFS_SNOOPING_OPS_pb, ¶m, 0444, "/sys/test/remote/pb");
|
||||||
|
if (error) {
|
||||||
|
panic("setup_remote_snooping_samples: pb");
|
||||||
|
}
|
||||||
|
|
||||||
|
error = sysfs_createf(SYSFS_SNOOPING_OPS_u32K, &lvalue, 0444, "/sys/test/remote/u32K");
|
||||||
|
if (error) {
|
||||||
|
panic("setup_remote_snooping_samples: u32K");
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
} /* setup_remote_snooping_samples() */
|
||||||
|
|
||||||
static void populate_sysfs(void)
|
static void populate_sysfs(void)
|
||||||
{
|
{
|
||||||
cpu_sysfs_setup();
|
cpu_sysfs_setup();
|
||||||
|
setup_remote_snooping_samples();
|
||||||
} /* populate_sysfs() */
|
} /* populate_sysfs() */
|
||||||
|
|
||||||
int host_ikc_inited = 0;
|
int host_ikc_inited = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user