On 06/14/2013 03:58 PM, lei yang wrote:
Hi expert,

I read the below page
https://github.com/autotest/virt-test/wiki/PerformanceTesting

I have a question, how could get the vcpu's thread id or vhost's thread id

Lei


If you are asking for the how autotest get them, you can check the code in qemu_vm.py

For vcpus autotest have a function to get them from the monitor:

    def get_vcpu_pids(self, params):
        """
        Return the list of vcpu PIDs

        @return: the list of vcpu PIDs
        """
        vcpu_thread_pattern = params.get("vcpu_thread_pattern",
                                         "thread_id=(\d+)")
        return [int(_) for _ in re.findall(vcpu_thread_pattern,
str(self.monitor.info("cpus")))]

And for vhost, object vm has this attribute, you can find the code in qemu_vm.py too, and it is get from the process ids:

self.vhost_threads = re.findall("\w+\s+(\d+)\s.*\[vhost-%s\]" %
                                            self.get_pid(), o)





_______________________________________________
Virt-test-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virt-test-devel

_______________________________________________
Virt-test-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virt-test-devel

Reply via email to