ucli: true_value

This commit is contained in:
zy
2023-12-06 03:20:22 -05:00
parent 1a45d3e409
commit d131daad16
2 changed files with 12 additions and 4 deletions

View File

@@ -45,6 +45,10 @@
// return switch_namespace(pid, "pid");
// }
// int switch_to_user_namespace(pid_t pid) {
// return switch_namespace(pid, "user");
// }
// void test(variable_monitor_task *tsk_info) {
// // host
// if (tsk_info->task.pid == tsk_info->task.container_pid){
@@ -66,6 +70,10 @@
// close(fd);
// return;
// }
// if (switch_to_user_namespace(tsk_info->task.pid) != 0) {
// close(fd);
// return;
// }
// // Do something with tgid...
// diag_printf_raw_stack(tsk_info->task.container_tgid,
@@ -99,13 +107,13 @@ static int task_info_extract(void *buf, unsigned int len, void *) {
printf("threshold exceeded, Timestamp %d :\n", vm_record->tv);
for (int i = 0; i < vm_record->threshold_num; i++) {
printf("\t: pid: %d, name: %s, ptr: %p, threshold:%d\n",
printf("\t: pid: %d, name: %s, ptr: %p, threshold:%d, true_value:%d\n",
vm_record->threshold_record[i].task_id,
vm_record->threshold_record[i]
.name, // Assuming name is a null-terminated string
vm_record->threshold_record[i].ptr,
vm_record->threshold_record[i].threshold
// vm_record->threshold_record[i].true_value
vm_record->threshold_record[i].threshold,
vm_record->threshold_record[i].true_value
);
}
break;

View File

@@ -37,7 +37,7 @@ typedef struct {
char name[MAX_NAME_LEN + 1]; // name
void *ptr; // virtual address
long long threshold; // threshold value
// long long true_value; // target true value
long long true_value; // target true value
} threshold;
typedef struct {