Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
pierregondois committed Dec 20, 2023
1 parent fe8eaad commit ae6ffeb
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
6 changes: 3 additions & 3 deletions lisa/_assets/kmodules/lisa/features.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ int __enable_feature(struct feature* feature) {
if (feature->enabled) {
ret = feature->__enable_ret;
} else {
pr_info("Enabling lisa feature %s\n", feature->name);
pr_err("Enabling lisa feature %s\n", feature->name);
if (feature->enable)
ret = feature->enable(feature);
else
Expand All @@ -41,7 +41,7 @@ int __disable_feature(struct feature* feature) {
} else {
feature->enabled--;
if (!feature->enabled) {
pr_info("Disabling lisa feature %s\n", feature->name);
pr_err("Disabling lisa feature %s\n", feature->name);
if (feature->disable)
ret = feature->disable(feature);
else
Expand Down Expand Up @@ -106,7 +106,7 @@ static int __enable_feature_explicitly(struct feature* feature) {
int init_features(char **selected, size_t selected_len) {
BUG_ON(MAX_FEATURES < ((__lisa_features_stop - __lisa_features_start) / sizeof(struct feature)));

pr_info("Available features:");
pr_err("Available features: ");
__process_features(NULL, 0, __list_feature);

// TODO: features are now only initialized if the event is requested.
Expand Down
2 changes: 1 addition & 1 deletion lisa/_assets/kmodules/lisa/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ static struct file_operations lisa_param_feature_fops = {
* umode_t);
*/

static int lisa_fs_syscall_mkdir(struct mnt_idmap *idmap,
static int lisa_fs_syscall_mkdir(struct user_namespace *idmap,
struct inode *inode, struct dentry *dentry,
umode_t mode)
{
Expand Down
6 changes: 3 additions & 3 deletions lisa/_assets/kmodules/lisa/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ static int __init modinit(void) {
int ret;

pr_info("Loading Lisa module version %s\n", LISA_MODULE_VERSION);
if (strcmp(version, LISA_MODULE_VERSION)) {
pr_err("Lisa module version check failed. Got %s, expected %s\n", version, LISA_MODULE_VERSION);
return -EPROTO;
// if (strcmp(version, LISA_MODULE_VERSION)) {
// pr_err("Lisa module version check failed. Got %s, expected %s\n", version, LISA_MODULE_VERSION);
// return -EPROTO;

ret = init_lisa_fs();
if (ret) {
Expand Down
4 changes: 4 additions & 0 deletions lisa/_assets/kmodules/lisa/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@
#undef pr_fmt
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

// TODO debug
#define pr_alloc(...) pr_err(__VA_ARGS__)
// pr_err(__VA_ARGS__)

#endif
6 changes: 4 additions & 2 deletions lisa/_kmod.py
Original file line number Diff line number Diff line change
Expand Up @@ -2318,7 +2318,7 @@ def cmd_cm():
populate_mod(mod_path)

logger.info(f'Compiling kernel module {self.mod_name}')
_subprocess_log(cmd, logger=logger, level=logging.DEBUG, extra_env=env)
_subprocess_log(cmd, logger=logger, level=logging.ERROR, extra_env=env)

mod_file = find_mod_file(mod_path)
with open(mod_file, 'rb') as f:
Expand Down Expand Up @@ -2558,7 +2558,9 @@ def kmod_cm():
target.push(str(host_temp), str(target_temp))
yield target_temp
finally:
target.remove(str(target_temp))
print(f"Module at {str(target_temp)}")
# pass
# target.remove(str(target_temp))

return self._install(kmod_cm())

Expand Down

0 comments on commit ae6ffeb

Please sign in to comment.