LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 03-31-2020, 05:10 PM   #1
shogun1234
Member
 
Registered: May 2004
Posts: 226

Rep: Reputation: 15
How measure boot time?


I only use qemu several time, so I am really newbie to qemu virtualization (but I am experience in using linux for several years). In linux, I know I can measure a command by time command. However, when I boot up an image using qemu-system-x86_64, how do I know how long qemu takes to boot the image until e.g. login screen gets display (or to boot a specific process)?

The information I find so far is https://stefano-garzarella.github.io...nux-boot-time/. But this looks like patching linux and qemu from source code. So I am curious is there any way to measure such metrics (boot time) without applying patch? For instance a flag in qemu command can be used to measure or monitor such info.

Qemu I use is version 4.1.0. Linux kernel version 5.2.0-2-amd64
 
Old 03-31-2020, 07:08 PM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,631

Rep: Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696
Why?

By that I mean, why do you want to measure boot time, and what are the criteria? It helps to know what you REALLY want to measure and why before suggesting an answer.
 
Old 04-01-2020, 03:02 AM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Any distro's boot time can be measured from within the distro, whether it's in a VM or not.
With systemd distros, the command is
Code:
systemd-analyze
(OK, strictly speaking that measures boot time from the moment init starts, not before)
 
1 members found this post helpful.
Old 04-01-2020, 03:48 PM   #4
shogun1234
Member
 
Registered: May 2004
Posts: 226

Original Poster
Rep: Reputation: 15
Update:
I managed to install kernel source 5.4 by apt-get source linux-source-5.4. And set PERF_EXEC_PATH to /path/to/linux-source-5.4/tools/perf. But the result is the same (no qemu_init_end error is still thrown).


Thanks for all the reply. I come across to https://github.com/stefano-garzarella/qemu-boot-time It looks like what I need. So I run the command based on How to use section by replacing qemu command I use. Then it generates qemu_perf.data. However when I try the command at [code]Example of output[/b]

Code:
perf script -s qemu-boot-time/perf-script/qemu-perf-script.py -i qemu_perf.data
It throws the following error message.

Code:
in trace_begin
Traceback (most recent call last):
  File "qemu-boot-time/perf-script/qemu-perf-script.py", line 195, in kvm__kvm_entry
    if (events.traces[pid].qemu_init_end != 0):
AttributeError: 'collections.defaultdict' object has no attribute 'qemu_init_end'
Fatal Python error: problem in Python trace event handler

It seems to me the problem stems from the qemu-perf-script.py line 125 (https://github.com/stefano-garzarell...script.py#L125) because it uses autodict() which default do not have qemu_init_end (but I could be wrong). However, when search packages with pip, pip3, or apt-cache I don't find any related packages e.g. pip3 search autodict, apt-cache search autodict. What packages should I install to fix this issue? Or any thing/ code that I should add in order to fix this (I haven't use autodict() so I am not sure how that works or any docs linking to that lib)?

Thanks for help

Last edited by shogun1234; 04-01-2020 at 04:08 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to measure kernel space time and user space time in linux bhas.bhaskar Linux - Newbie 1 11-28-2010 11:01 AM
LXer: Measure Time in Linux with Time Base LXer Syndicated Linux News 0 04-11-2007 06:46 AM
How to measure the time to build a package? mullog Linux From Scratch 10 05-11-2004 11:23 AM
accurately measure time rasselin Programming 1 09-05-2003 05:18 PM
how to accurately measure processing time rasselin Programming 3 09-01-2003 11:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 07:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration