The download url is dead and needs to be updated.
Signed-off-by: yezengruan <yezengruan@huawei.com>
(cherry picked from commit 3803cd48b8e5fe6d9142624b21d459b22d3d06ee)
vcpu_list: pre malloc vcpu list to improve performance
performance: del unnecessary memcpy and memset
keyboard: change wait time to 3s
performance: change memset location
proc: del unused items getting from proc stat refresh
proc: del loop sscanf for proc pid stat file
utils: del realpath from read_file
Signed-off-by: nocjj <1250062498@qq.com>
Since the path in read_file is constructed by vmtop, there is no need
to use realpath to modify the path. So, del realpath to release cpu time.
Signed-off-by: nocjj <1250062498@qq.com>
Loop sscanf and strtok will take a long cpu time, since
get_proc_stat is called per thread. So, replace these with a single sscanf,
which will save much cpu time.
Signed-off-by: nocjj <1250062498@qq.com>
Currently, vmtop gets a lot of items from /proc/pid/stat, and there
are many unused data in these items, which will add a lot of cpu usage.
So, del these item's getting process.
Signed-off-by: nocjj <1250062498@qq.com>
There is no need to clear all mem in add_domains, beacause memcpy will
write the front section. We only need to clear the mem in the end, which
will improve the performance.
Signed-off-by: nocjj <1250062498@qq.com>
There is no need to malloc a new mem to save old domain list data,
and now->domains and pre->domains are pointers.
So assign now->domains to pre->domains satisfies the requirement.
Signed-off-by: nocjj <1250062498@qq.com>
It costs a lot of time to malloc and memset vcpu_list while getting a new vcpu.
And vcpu num is limited to MAX_VCPU_NUM = 1024, so pre malloc MAX_VCPU_NUM mem,
which will improve vmtop cpu usage a lot.
Signed-off-by: nocjj <1250062498@qq.com>
Currently, vmtop uses halfdelay to set waiting timeout of input.
But, halfdelay's timeout can only be between 1~255, which limits vmtop's
functioniing.
Signed-off-by: nocjj <1250062498@qq.com>
Currently, vmtop release version has been update to 1.1, but
version in configure.ac is still 1.0. So, update release
version to configure.ac.
Signed-off-by: nocjj <1250062498@qq.com>
If display fields items is more than screen rows, some of fields items
can't be displayed in screen.
So, start another col to show fields items if screen can't show all content in one col.
Signed-off-by: Jiajun Chen <1250062498@qq.com>
Change source url to openeuler repo, and replace tar with
openeuler/vmtop tag v1.1(which is same as v1.0.1):
wget -O vmtop-1.1.tar.gz https://gitee.com/openeuler/vmtop/repository/
archive/v1.1.tar.gz#/vmtop-1.1.tar.gz
Previous judgement to determine whether the vcpustat info matches the process is:
strstr(buf, pid) == buf + 1
But there is an exception that the kvm exit times may contain process pid string.
And then, we will calculate the delta between two defferent process.
So, modify this judgement codition.