Skip to content

Conversation

@ndokos
Copy link
Member

@ndokos ndokos commented Mar 17, 2016

This is probably most important for turbostat (it does not run
in VMs), but we may have to extend it to other tools.

@ndokos ndokos added this to the v0.39 milestone Jun 10, 2016
@ndokos ndokos self-assigned this Jun 10, 2016
@ndokos ndokos force-pushed the wip-check-turbostat-kill branch from 56161af to 409c3a8 Compare June 15, 2016 19:35
# check that the pid corresponds to the tool
pidlist=$(pidof $tool)
for p in $pidlist ;do
if [ $p == $pid ] ;then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we record if we found the given pid in the pidlist? It does not appear so.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right.

@ndokos ndokos force-pushed the wip-check-turbostat-kill branch from 409c3a8 to 9ca0707 Compare June 15, 2016 21:20
@portante
Copy link
Member

portante commented Jul 7, 2016

This looks good to me, but I have not tested it. Having some kind of testing infrastructure for it would be great.

@ndokos ndokos force-pushed the wip-check-turbostat-kill branch 3 times, most recently from 7a837bc to a55d7dc Compare July 9, 2016 05:08
@ndokos
Copy link
Member Author

ndokos commented Jul 9, 2016

@portante: test-07 is wonky (it does not go through any kill - kvmtrace does some peculiar things) so I'll probably replace it with some other tool, but the rest (test-05 through -10) should be OK. Let me know what you think.

@ndokos ndokos force-pushed the wip-check-turbostat-kill branch from a55d7dc to 646d1c1 Compare July 11, 2016 15:54
@ndokos
Copy link
Member Author

ndokos commented Jul 11, 2016

@portante: I replaced the kvmtrace with its peculiarities with the more generic vmstat. This should be ready to merge.

tool_pid_file=$pbench_tmp/$group.$iteration.$tool.pid
tool_output_file=$tool_output_dir/$tool.txt

mkdir $tool_output_dir
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure we always want to do this? It used to only occur on start. Do we need this just to make unit tests pass?

Copy link
Member Author

@ndokos ndokos Jul 12, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it was needed for unit tests to pass, but after I reverted it, the unit tests passed anyway, so it is completely unnecessary.

@ndokos ndokos force-pushed the wip-check-turbostat-kill branch 2 times, most recently from 82337e2 to 60a6e07 Compare July 14, 2016 18:50
ndokos added 4 commits July 14, 2016 15:33
Check that the pid corresponds to the tool before killing it.
If there is no process with that pid, eat the error.
If the kill succeeds, return success.
Otherwise check if the process is still running: kill it forcibly
if necessary, but return failure in that case.

pbench-kill-tools: Check that the list of pids to kill is not empty.
The kvmstat, vmstat, numastat and turbostat test cases actually go
through safe_kill.  The iostat and sar cases do not currently.
Assuming that no problems are found with safe_kill, it will be
ported to the rest of the tools.
Each tool script belongs to a 3- or 4-deep process hierarchy of which
pidof returned one pid (and not necessarily the one that was stored in
the tool pid file); consequently, safe_kill would skip it and there were
tools (and their screens) hanging around at the end.

Use pidof -x to get the complete list.

Change the relevant unit tests (and the mocked pidof) to accommodate
this change.
@ndokos ndokos force-pushed the wip-check-turbostat-kill branch from 60a6e07 to 75ca51c Compare July 14, 2016 19:34
@portante portante merged commit 53d5901 into distributed-system-analysis:master Jul 15, 2016
@ndokos ndokos deleted the wip-check-turbostat-kill branch July 15, 2016 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants