feat(log): 将内核日志统一为新的logger (#814)

This commit is contained in:
曾俊
2024-05-16 17:25:23 +08:00
committed by GitHub
parent 92deae638b
commit 2eab6dd743
181 changed files with 1321 additions and 1261 deletions

View File

@ -59,10 +59,10 @@ let x :Mutex<Vec<i32>>= Mutex::new(Vec::new());
g.push(2);
assert!(g.as_slice() == [1, 2, 2] || g.as_slice() == [2, 2, 1]);
// 在此处Mutex是加锁的状态
kdebug!("x={:?}", x);
debug!("x={:?}", x);
}
// 由于上方的变量`g`也就是Mutex守卫的生命周期结束自动释放了Mutex。因此在此处Mutex是放锁的状态
kdebug!("x={:?}", x);
debug!("x={:?}", x);
```
&emsp;&emsp;对于结构体内部的变量我们可以使用Mutex进行细粒度的加锁也就是使用Mutex包裹需要细致加锁的成员变量比如这样

View File

@ -65,10 +65,10 @@ let x :SpinLock<Vec<i32>>= SpinLock::new(Vec::new());
g.push(2);
assert!(g.as_slice() == [1, 2, 2] || g.as_slice() == [2, 2, 1]);
// 在此处SpinLock是加锁的状态
kdebug!("x={:?}", x);
debug!("x={:?}", x);
}
// 由于上方的变量`g`也就是SpinLock守卫的生命周期结束自动释放了SpinLock。因此在此处SpinLock是放锁的状态
kdebug!("x={:?}", x);
debug!("x={:?}", x);
```
&emsp;&emsp;对于结构体内部的变量我们可以使用SpinLock进行细粒度的加锁也就是使用SpinLock包裹需要细致加锁的成员变量比如这样