Re: [PATCH v1] perf test: Introduce script for data symbol parsing

From: Leo Yan
Date: Wed Aug 03 2022 - 21:07:49 EST


Hi Ian,

On Wed, Aug 03, 2022 at 04:06:04PM -0700, Ian Rogers wrote:

[...]

> > +echo "Compiling test program..."
> > +cc $TEST_PROGRAM_SOURCE -o $TEST_PROGRAM || exit 1
> > +
> > +echo "Recording workload..."
> > +perf mem record --all-user -o ${PERF_DATA} -- $TEST_PROGRAM &
> > +PERFPID=$!
>
> I wonder here you could do:
> TESTPID=$(ps -o pid -h --ppid "$PERFPID")

I tried this command and found "$TESTPID" is empty string. So the
test command doesn't create child process.

> > +sleep 1
> > +
> > +kill $PERFPID
> > +wait $PERFPID
> > +# test program may leave an orphan process running the workload
> > +killall $(basename $TEST_PROGRAM)
>
> And then here kill $TESTPID to avoid the killall which worries me a little.

Yeah, I referred the code from another script test_arm_spe_fork.sh,
this script doesn't fork new child process. So here I get over
complexity, will drop "killall $(basename $TEST_PROGRAM)" in next
version.

Thanks a lot for reviewing!

Leo