New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
qemu dump new cases development #2457
Conversation
b98c05a
to
27e5f75
Compare
(1/2) Host_RHEL.m8.u3.product_av.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.8.3.0.x86_64.io-github-autotest-qemu.dump_guest_core.on.q35: PASS (234.56 s) |
@MiriamDeng Could you please help review this patch?Thanks! |
I can only see the job's name for x86 but it is supported on ppc too. |
qemu/tests/dump_guest_core.py
Outdated
% gdb_command_file, shell=True) | ||
process.run("echo \"set height 0\" >> %s" | ||
% gdb_command_file, shell=True) | ||
process.run("echo \"dump-guest-memory /tmp/vmcore X86_64\" >> %s" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this step only support x86 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is not only for x86,since it is not specified in test case.
Could you help confirm this on ppc?Thanks!
Those info seems should described in commit. |
6de42df
to
c87cd0b
Compare
@MiriamDeng Could you help review this patch again?Thanks! |
@vivianQizhu Could you help review this patch? Thanks! |
The first job got failures on ppc, could you check ? During handling of the above exception, another exception occurred: Traceback (most recent call last): (3/4) Host_RHEL.m8.u3.product_av.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.8.3.0.ppc64le.io-github-autotest-qemu.dump_guest_core.on: FAIL: Vmcore corrupt (261.97 s) |
c87cd0b
to
06cba79
Compare
This seems to only be encountered on ppc, could you please help to confirm? |
qemu/tests/dump_guest_core.py
Outdated
% gdb_command_file, shell=True) | ||
process.run("echo \"set height 0\" >> %s" | ||
% gdb_command_file, shell=True) | ||
process.run("echo \"dump-guest-memory /tmp/vmcore X86_64\" >> %s" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We had better provide parameter for "x86_64" since the value should be ''ppc64le" on ppc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we discussed, if confirmed this value will change based on architecture changes, then I will change it. Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use "ppc64-le" for this command on ppc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok,thanks!
And I also realized we had an existed bz 1785126, so I wonder if the patch fails or not on both x86 and ppc finally, thanks a lot. |
06cba79
to
45a8534
Compare
Yes, I know this bz. We can discuss privately. |
Hi Leiwang, warning: Ignoring non-absolute filename: <linux-vdso64.so.1> Thanks |
This error only appears in ppc, maybe we need to discuss this error later. |
I didn't meet the issue by manual last time, It's fine for me to discuss it later, thanks. |
f860a7c
to
ad738dd
Compare
@MiriamDeng Could you please review this patch again? |
Could you help to check the patch again ? Thanks
|
Finally it passed on ppc |
LGTM |
qemu/tests/cfg/dump_guest_core.cfg
Outdated
virt_test_type = qemu | ||
start_vm = no | ||
pre_command = "ulimit -c unlimited" | ||
pre_command1 = "echo "/var/core.%p" > /proc/sys/kernel/core_pattern" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pre_command1 = "echo "/var/core.%p" > /proc/sys/kernel/core_pattern" | |
pre_command + = " && echo "/var/core.%p" > /proc/sys/kernel/core_pattern" |
qemu/tests/cfg/dump_guest_core.cfg
Outdated
gdb_command_file = "/home/gdb_command" | ||
crash_script = "/home/crash.cmd" | ||
vmcore_file = "/tmp/vmcore" | ||
extra_params += " -machine dump-guest-core=%s" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might move this line down to the bottom and extra_params += " -machine dump-guest-core=${dump_guest_core}"
qemu/tests/dump_guest_core.py
Outdated
pre_command = params.get("pre_command") | ||
pre_command1 = params.get("pre_command1") | ||
crash_script = params.get("crash_script") | ||
vmcore_file = params.get("vmcore_file") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
params['xxx']
instead of params.get()
when the params can not be None.
qemu/tests/dump_guest_core.py
Outdated
vmcore_file = params.get("vmcore_file") | ||
|
||
process.run(pre_command, shell=True) | ||
process.run(pre_command1, shell=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
env_process
will help you run the command when you define pre_command
.
qemu/tests/dump_guest_core.py
Outdated
process.run(pre_command, shell=True) | ||
process.run(pre_command1, shell=True) | ||
|
||
params["extra_params"] %= dump_guest_core |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you remove this one, and pre command does not need you run it by yourself, then it should be fine to remove start_vm=no
in cfg and directly start vm with those prepared configurations.
qemu/tests/dump_guest_core.py
Outdated
process.run("echo \"set height 0\" >> %s" | ||
% gdb_command_file, shell=True) | ||
if params['vm_arch_name'] == 'x86_64': | ||
process.run("echo \"dump-guest-memory /tmp/vmcore X86_64\" >> %s" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vmcore_file
instead of /tmp/vmcore
qemu/tests/dump_guest_core.py
Outdated
process.run("echo \"dump-guest-memory /tmp/vmcore X86_64\" >> %s" | ||
% gdb_command_file, shell=True) | ||
if params['vm_arch_name'] == 'ppc64le': | ||
process.run("echo \"dump-guest-memory /tmp/vmcore ppc64-le\" >> %s" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
qemu/tests/dump_guest_core.py
Outdated
""" | ||
Use gdb to check core dump file | ||
""" | ||
process.run("echo \"source /usr/share/qemu-kvm/dump-guest-memory.py\" > %s" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better define a variable for this path.
qemu/tests/dump_guest_core.py
Outdated
process.run("echo \"dump-guest-memory /tmp/vmcore ppc64-le\" >> %s" | ||
% gdb_command_file, shell=True) | ||
process.run("echo bt >> %s" % gdb_command_file, shell=True) | ||
process.run("echo quit >> %s" % gdb_command_file, shell=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
echo -e "bt\nquit" >>...
qemu/tests/dump_guest_core.py
Outdated
process.run("echo bt > %s" % crash_script, shell=True) | ||
process.run("echo task 0 >> %s" % crash_script, shell=True) | ||
process.run("echo task 1 >> %s" % crash_script, shell=True) | ||
process.run("echo quit >> %s" % crash_script, shell=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, echo -e
with \n
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much,updated the code that you pointed out.
Could you please review this patch again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
process.run('echo -e "bt\\ntask 0\\ntask 1\\nquit" > %s' % crash_script, shell=True)
0b85dc5
to
b0d4435
Compare
qemu/tests/dump_guest_core.py
Outdated
if params['vm_arch_name'] == 'ppc64le': | ||
process.run("echo \"dump-guest-memory %s ppc64-le\" >> %s" | ||
% (vmcore_file, gdb_command_file), shell=True) | ||
process.run("echo -e 'bt\nquit' >> %s" % gdb_command_file, shell=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
arch = params['vm_arch_name']
arch = 'ppc64-le' if params['vm_arch_name'] == 'ppc64le' else arch
command = ('echo -e "source %s\\nset height 0\\ndump-guest-memory'
' %s %s\\nbt\\nquit" >> %s' % (dump_guest_memory_file,
vmcore_file, arch,
gdb_command_file))
process.run(command, shell=True)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the code.Thanks!
f6dafd2
to
aa0c698
Compare
qemu/tests/cfg/dump_guest_core.cfg
Outdated
extra_params += " -machine dump-guest-core=${dump_guest_core}" | ||
- off: | ||
dump_guest_core = off | ||
extra_params += " -machine dump-guest-core=${dump_guest_core}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
variants:
- on:
dump_guest_core = on
- off:
dump_guest_core = off
extra_params += " -machine dump-guest-core=${dump_guest_core}"
qemu/tests/dump_guest_core.py
Outdated
env_process.preprocess_vm) | ||
vm = env.get_vm(params["main_vm"]) | ||
session = vm.wait_for_login() | ||
host_kernel_version = process.getoutput("uname -r").strip() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommend to move this line inside check_env()
to make the function more integrated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since check_vmcore_file()
also references host_kernel_version
, it cannot be moved to check_env()
qemu/tests/dump_guest_core.py
Outdated
|
||
qemu_id = vm.get_pid() | ||
gdb_command %= qemu_id | ||
core_file = '/var/core.' + str(qemu_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a fixed variable defined before gdb_command
, who should reference it, or /var/core.
should be separately defined before pre_command
, where reference it too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the code.Thanks
27458ac
to
9ff23ba
Compare
@vivianQizhu Could you please review this patch again?Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make sure you test it before submit the code.
qemu/tests/dump_guest_core.py
Outdated
% crash_script, shell=True) | ||
crash_cmd = "crash -i %s /usr/lib/debug/lib/modules/%s/vmlinux %s" | ||
crash_cmd %= (crash_script, host_kernel_version, vmcore_file) | ||
status, output = process.getstatusoutput(crash_cmd, timeout=60) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If status is useless here could be output = process.getoutput(crash_cmd, timeout=60)
qemu/tests/dump_guest_core.py
Outdated
host_kernel_version = process.getoutput("uname -r").strip() | ||
env_process.process(test, params, env, | ||
env_process.preprocess_image, | ||
env_process.preprocess_vm) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line could be dropped.
utils_package.package_install(packages) | ||
|
||
trigger_core_dump_command = params["trigger_core_dump_command"] | ||
core_file = params["core_file"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see where you define core_file
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, it is because i test this on my host, then modify the code on my laptop and push it to github.I will be careful next time.
Thanks!
b96c3e9
to
0d12329
Compare
JOB ID : 27df29f3a00ade5c2a1bc92251c98058bce38da0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM Otherwise.
qemu/tests/cfg/dump_guest_core.cfg
Outdated
crash_script = "/home/crash.cmd" | ||
vmcore_file = "/tmp/vmcore" | ||
core_file = "/var/core.%s" | ||
gdb_command = "gdb %s --command=${gdb_command_file}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean:
core_file = "/var/core"
pre_command += "&& echo "${core_file}.%p" > /proc/sys/kernel/core_pattern"
gdb_command = "gdb ${core_file}.%s --command=${gdb_command_file}"
qemu/tests/cfg/dump_guest_core.cfg
Outdated
vmcore_file = "/tmp/vmcore" | ||
core_file = "/var/core.%s" | ||
gdb_command = "gdb %s --command=${gdb_command_file}" | ||
crash_cmd = "crash -i ${crash_script} /usr/lib/debug/lib/modules/%s/vmlinux %s" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here: crash_cmd = "crash -i ${crash_script} /usr/lib/debug/lib/modules/%s/vmlinux ${vmcore_file}"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, thanks for your help, the code has been updated.Will update test result later.
0d12329
to
d0c5589
Compare
JOB ID : c406b1473b242278aa8a8bb9cd02094beeaf3e04 |
@MiriamDeng Request for your re-review since the code changes, thanks. |
It looks good to me from ppc side. Thanks |
JOB LOG : /root/avocado/job-results/job-2020-11-23T23.21-f887006/job.log |
5f23eda
to
82e81e0
Compare
1.Use gdb check core dump file 2.Use crash check vmcore file Signed-off-by: Leidong Wang <leidwang@redhat.com>
82e81e0
to
3fdab30
Compare
Thanks @leidwang @MiriamDeng |
dump_guest_core.py:qemu dump new cases development
1.Use gdb check core dump file
2.Use crash check vmcore file
ID:1888531, 1888532
Signed-off-by: Leidong Wang leidwang@redhat.com