mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-09 03:57:24 +00:00
devices: virtio: fs: Include tag name in worker thread name
This will allow us to identify virtiofs threads in tracing tools such as perfetto. BUG=b:260038313 TEST=run arcvm Change-Id: I198b599a3f710742fc549ab6ae376ad4cb661fc0 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4045667 Reviewed-by: David Stevens <stevensd@chromium.org> Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
This commit is contained in:
parent
5e35436666
commit
c789769acf
1 changed files with 8 additions and 7 deletions
|
@ -131,6 +131,7 @@ pub type Result<T> = ::std::result::Result<T, Error>;
|
|||
|
||||
pub struct Fs {
|
||||
cfg: virtio_fs_config,
|
||||
tag: String,
|
||||
fs: Option<PassthroughFs>,
|
||||
queue_sizes: Box<[u16]>,
|
||||
avail_features: u64,
|
||||
|
@ -167,6 +168,7 @@ impl Fs {
|
|||
|
||||
Ok(Fs {
|
||||
cfg,
|
||||
tag: tag.to_string(),
|
||||
fs: Some(fs),
|
||||
queue_sizes: vec![QUEUE_SIZE; num_queues].into_boxed_slice(),
|
||||
avail_features: base_features,
|
||||
|
@ -295,13 +297,12 @@ impl VirtioDevice for Fs {
|
|||
let irq = interrupt.clone();
|
||||
let socket = Arc::clone(&socket);
|
||||
|
||||
let worker_result =
|
||||
thread::Builder::new()
|
||||
.name(format!("v_fs:{idx}"))
|
||||
.spawn(move || {
|
||||
let mut worker = Worker::new(mem, queue, server, irq, socket, slot);
|
||||
worker.run(evt, kill_evt, watch_resample_event)
|
||||
});
|
||||
let worker_result = thread::Builder::new()
|
||||
.name(format!("v_fs:{}:{}", self.tag, idx))
|
||||
.spawn(move || {
|
||||
let mut worker = Worker::new(mem, queue, server, irq, socket, slot);
|
||||
worker.run(evt, kill_evt, watch_resample_event)
|
||||
});
|
||||
|
||||
if watch_resample_event {
|
||||
watch_resample_event = false;
|
||||
|
|
Loading…
Reference in a new issue