VARIABLE_MONITOR_TYPE
This commit is contained in:
@@ -140,7 +140,7 @@ void diag_task_info_work(struct work_struct *work) {
|
||||
kernel_watch_arg *kwarg;
|
||||
|
||||
vm_record.id = event_id;
|
||||
vm_record.et_type = 0; //! todo event type
|
||||
vm_record.et_type = VARIABLE_MONITOR_RECORD_TYPE;
|
||||
vm_record.tv = ktime_get_real();
|
||||
vm_record.threshold_num = k_watch_timer->threshold_num;
|
||||
|
||||
@@ -180,7 +180,7 @@ void diag_task_info_work(struct work_struct *work) {
|
||||
|
||||
get_task_struct(p); // count +1
|
||||
|
||||
tsk_info.et_type = 1; //! todo event type
|
||||
tsk_info.et_type = VARIABLE_MONITOR_TASK_TYPE;
|
||||
tsk_info.id = event_id;
|
||||
tsk_info.tv = vm_record.tv;
|
||||
diag_tsk(p, &tsk_info);
|
||||
@@ -315,53 +315,6 @@ enum hrtimer_restart check_variable_cb(struct hrtimer *timer) {
|
||||
}
|
||||
|
||||
int diag_test(int nid) {
|
||||
// static struct task_struct *tsk;
|
||||
// static struct task_struct *leader;
|
||||
// static variable_monitor_task tsk_info;
|
||||
// // unsigned int nr_bt;
|
||||
|
||||
// int ret;
|
||||
// unsigned long flags;
|
||||
// pid_t id = (pid_t)nid;
|
||||
|
||||
// rcu_read_lock();
|
||||
// tsk = NULL;
|
||||
// if (orig_find_task_by_vpid)
|
||||
// tsk = orig_find_task_by_vpid(id);
|
||||
// if (!tsk) {
|
||||
// ret = -EINVAL;
|
||||
// rcu_read_unlock();
|
||||
// return ret;
|
||||
// }
|
||||
|
||||
// leader = tsk->group_leader;
|
||||
// if (leader == NULL || leader->exit_state == EXIT_ZOMBIE){
|
||||
// ret = -EINVAL;
|
||||
// rcu_read_unlock();
|
||||
// return ret;
|
||||
// }
|
||||
|
||||
// get_task_struct(tsk);
|
||||
// rcu_read_unlock();
|
||||
|
||||
// tsk_info.et_type = 1;
|
||||
// test(tsk, &tsk_info);
|
||||
|
||||
// put_task_struct(tsk);
|
||||
// printk(KERN_INFO "put_task_struct finish\n");
|
||||
|
||||
// diag_variant_buffer_spin_lock(&load_monitor_variant_buffer, flags);
|
||||
// printk(KERN_INFO "1\n");
|
||||
// diag_variant_buffer_reserve(&load_monitor_variant_buffer,sizeof(variable_monitor_task));
|
||||
// printk(KERN_INFO "2\n");
|
||||
// diag_variant_buffer_write_nolock(&load_monitor_variant_buffer, &tsk_info,
|
||||
// sizeof(variable_monitor_task));
|
||||
// printk(KERN_INFO "3\n");
|
||||
// diag_variant_buffer_seal(&load_monitor_variant_buffer);
|
||||
// printk(KERN_INFO "4\n");
|
||||
// diag_variant_buffer_spin_unlock(&load_monitor_variant_buffer, flags);
|
||||
// printk(KERN_INFO "5\n");
|
||||
|
||||
struct task_struct *g, *p; // g: task group; p: task
|
||||
unsigned long flags;
|
||||
unsigned long event_id = get_cycles();
|
||||
@@ -369,27 +322,7 @@ int diag_test(int nid) {
|
||||
static variable_monitor_task tsk_info = {0};
|
||||
static variable_monitor_record vm_record = {0};
|
||||
|
||||
// vm_record.id = event_id;
|
||||
// vm_record.et_type = 0; //! todo event type
|
||||
vm_record.tv = ktime_get_real();
|
||||
// vm_record.threshold_num = j;
|
||||
|
||||
// printk("-------------------------------------\n");
|
||||
// printk("-------------watch monitor-----------\n");
|
||||
// printk("Threshold reached:\n");
|
||||
// for (i = 0; i < j; i++) {
|
||||
// kwarg = &k_watch_timer->k_watch_args[buffer[i]];
|
||||
// k_w_arg2threshold(kwarg, &vm_record.threshold_record[i]);
|
||||
// }
|
||||
// rcu_read_lock();
|
||||
|
||||
// diag_variant_buffer_spin_lock(&load_monitor_variant_buffer, flags);
|
||||
// diag_variant_buffer_reserve(&load_monitor_variant_buffer,
|
||||
// sizeof(variable_monitor_record));
|
||||
// diag_variant_buffer_write_nolock(&load_monitor_variant_buffer, &vm_record,
|
||||
// sizeof(variable_monitor_record));
|
||||
// diag_variant_buffer_seal(&load_monitor_variant_buffer);
|
||||
// diag_variant_buffer_spin_unlock(&load_monitor_variant_buffer, flags);
|
||||
|
||||
rcu_read_unlock();
|
||||
|
||||
@@ -399,7 +332,7 @@ int diag_test(int nid) {
|
||||
|
||||
get_task_struct(p);
|
||||
|
||||
tsk_info.et_type = 1; //! todo event type
|
||||
tsk_info.et_type = VARIABLE_MONITOR_TASK_TYPE;
|
||||
tsk_info.id = event_id;
|
||||
tsk_info.tv = vm_record.tv;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user