[PATCH 0/3] Add Scripts for Finding Top 25 Executed Functions

Ahmed Karaman posted 3 patches 3 years, 11 months ago
Test FreeBSD passed
Test asan failed
Test docker-quick@centos7 passed
Test checkpatch passed
Test docker-mingw@fedora passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200616231204.8850-1-ahmedkhaledkaraman@gmail.com
Maintainers: Ahmed Karaman <ahmedkhaledkaraman@gmail.com>
There is a newer version of this series
MAINTAINERS                             |  7 ++
scripts/performance/callgrind_top_25.py | 95 +++++++++++++++++++++++++
scripts/performance/perf_top_25.py      | 82 +++++++++++++++++++++
3 files changed, 184 insertions(+)
create mode 100644 scripts/performance/callgrind_top_25.py
create mode 100644 scripts/performance/perf_top_25.py
[PATCH 0/3] Add Scripts for Finding Top 25 Executed Functions
Posted by Ahmed Karaman 3 years, 11 months ago
Greetings,

As a part of the TCG Continous Benchmarking project for GSoC this
year, detailed reports discussing different performance measurement
methodologies and analysis results will be sent here on the mailing
list.

The project's first report is currently being revised and will be
posted on the mailing list in the next few days.
A section in this report will deal with measuring the top 25 executed
functions when running QEMU. It includes two Python scripts that
automatically perform this task.

This series adds these two scripts to a new performance directory
created under the scripts directory. It also adds a new
"Miscellaneous" section to the end of the MAINTAINERS file with a
"Performance Tools and Tests" subsection.

Best regards,
Ahmed Karaman

Ahmed Karaman (3):
  MAINTAINERS: Add 'Miscellaneous' section
  scripts/performance: Add callgrind_top_25.py script
  scripts/performance: Add perf_top_25.py script

 MAINTAINERS                             |  7 ++
 scripts/performance/callgrind_top_25.py | 95 +++++++++++++++++++++++++
 scripts/performance/perf_top_25.py      | 82 +++++++++++++++++++++
 3 files changed, 184 insertions(+)
 create mode 100644 scripts/performance/callgrind_top_25.py
 create mode 100644 scripts/performance/perf_top_25.py

-- 
2.17.1


Re: [PATCH 0/3] Add Scripts for Finding Top 25 Executed Functions
Posted by no-reply@patchew.org 3 years, 11 months ago
Patchew URL: https://patchew.org/QEMU/20200616231204.8850-1-ahmedkhaledkaraman@gmail.com/



Hi,

This series failed the asan build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
export ARCH=x86_64
make docker-image-fedora V=1 NETWORK=1
time make docker-test-debug@fedora TARGET_LIST=x86_64-softmmu J=14 NETWORK=1
=== TEST SCRIPT END ===

  GEN     docs/interop/qemu-qmp-ref.html
  GEN     docs/interop/qemu-qmp-ref.txt
  GEN     docs/interop/qemu-qmp-ref.7
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
  CC      qga/commands.o
  CC      qga/guest-agent-command-state.o
  CC      qga/main.o
---
  GEN     docs/interop/qemu-ga-ref.html
  GEN     docs/interop/qemu-ga-ref.txt
  GEN     docs/interop/qemu-ga-ref.7
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
  LINK    qemu-ga
  LINK    qemu-keymap
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
  LINK    ivshmem-client
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
  LINK    ivshmem-server
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
  LINK    qemu-nbd
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
  LINK    qemu-storage-daemon
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
  AS      pc-bios/optionrom/multiboot.o
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
  AS      pc-bios/optionrom/linuxboot.o
  CC      pc-bios/optionrom/linuxboot_dma.o
  AS      pc-bios/optionrom/kvmvapic.o
---
  BUILD   pc-bios/optionrom/kvmvapic.raw
  BUILD   pc-bios/optionrom/pvh.raw
  SIGN    pc-bios/optionrom/multiboot.bin
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
  SIGN    pc-bios/optionrom/linuxboot.bin
  SIGN    pc-bios/optionrom/linuxboot_dma.bin
  SIGN    pc-bios/optionrom/kvmvapic.bin
  SIGN    pc-bios/optionrom/pvh.bin
  LINK    qemu-edid
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
  LINK    fsdev/virtfs-proxy-helper
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
  LINK    scsi/qemu-pr-helper
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
  LINK    qemu-bridge-helper
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
  LINK    virtiofsd
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
  LINK    vhost-user-input
/usr/bin/ld: /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors_vfork.S.o): warning: common of `__interception::real_vfork' overridden by definition from /usr/lib64/clang/10.0.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cpp.o)
  GEN     x86_64-softmmu/hmp-commands.h
  GEN     x86_64-softmmu/hmp-commands-info.h
  GEN     x86_64-softmmu/config-devices.h
---
  CC      x86_64-softmmu/accel/tcg/tcg-all.o
  CC      x86_64-softmmu/accel/tcg/cputlb.o
  CC      x86_64-softmmu/accel/tcg/tcg-runtime.o
/tmp/qemu-test/src/fpu/softfloat.c:3365:13: error: bitwise negation of a boolean expression; did you mean logical negation? [-Werror,-Wbool-operation]
    absZ &= ~ ( ( ( roundBits ^ 0x40 ) == 0 ) & roundNearestEven );
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            !
/tmp/qemu-test/src/fpu/softfloat.c:3423:18: error: bitwise negation of a boolean expression; did you mean logical negation? [-Werror,-Wbool-operation]
        absZ0 &= ~ ( ( (uint64_t) ( absZ1<<1 ) == 0 ) & roundNearestEven );
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                 !
/tmp/qemu-test/src/fpu/softfloat.c:3483:18: error: bitwise negation of a boolean expression; did you mean logical negation? [-Werror,-Wbool-operation]
        absZ0 &= ~(((uint64_t)(absZ1<<1) == 0) & roundNearestEven);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                 !
/tmp/qemu-test/src/fpu/softfloat.c:3606:13: error: bitwise negation of a boolean expression; did you mean logical negation? [-Werror,-Wbool-operation]
    zSig &= ~ ( ( ( roundBits ^ 0x40 ) == 0 ) & roundNearestEven );
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            !
/tmp/qemu-test/src/fpu/softfloat.c:3760:13: error: bitwise negation of a boolean expression; did you mean logical negation? [-Werror,-Wbool-operation]
    zSig &= ~ ( ( ( roundBits ^ 0x200 ) == 0 ) & roundNearestEven );
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            !
/tmp/qemu-test/src/fpu/softfloat.c:3987:21: error: bitwise negation of a boolean expression; did you mean logical negation? [-Werror,-Wbool-operation]
                    ~ ( ( (uint64_t) ( zSig1<<1 ) == 0 ) & roundNearestEven );
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                    !
/tmp/qemu-test/src/fpu/softfloat.c:4003:22: error: bitwise negation of a boolean expression; did you mean logical negation? [-Werror,-Wbool-operation]
            zSig0 &= ~ ( ( (uint64_t) ( zSig1<<1 ) == 0 ) & roundNearestEven );
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                     !
/tmp/qemu-test/src/fpu/softfloat.c:4273:18: error: bitwise negation of a boolean expression; did you mean logical negation? [-Werror,-Wbool-operation]
        zSig1 &= ~ ( ( zSig2 + zSig2 == 0 ) & roundNearestEven );
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                 !
8 errors generated.
make[1]: *** [/tmp/qemu-test/src/rules.mak:69: fpu/softfloat.o] Error 1
make[1]: *** Waiting for unfinished jobs....
/tmp/qemu-test/src/migration/ram.c:919:45: error: implicit conversion from 'unsigned long' to 'double' changes value from 18446744073709551615 to 18446744073709551616 [-Werror,-Wimplicit-int-float-conversion]
            xbzrle_counters.encoding_rate = UINT64_MAX;
                                          ~ ^~~~~~~~~~
/usr/include/stdint.h:130:23: note: expanded from macro 'UINT64_MAX'
---
18446744073709551615UL
^~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[1]: *** [/tmp/qemu-test/src/rules.mak:69: migration/ram.o] Error 1
make: *** [Makefile:527: x86_64-softmmu/all] Error 2
Traceback (most recent call last):
  File "./tests/docker/docker.py", line 669, in <module>
    sys.exit(main())
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=b86d77e6bea74d3faa899c5f3e7fd396', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=x86_64-softmmu', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-d5nmmrdj/src/docker-src.2020-06-16-19.31.41.20160:/var/tmp/qemu:z,ro', 'qemu:fedora', '/var/tmp/qemu/run', 'test-debug']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=b86d77e6bea74d3faa899c5f3e7fd396
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-d5nmmrdj/src'
make: *** [docker-run-test-debug@fedora] Error 2

real    3m50.170s
user    0m7.675s


The full log is available at
http://patchew.org/logs/20200616231204.8850-1-ahmedkhaledkaraman@gmail.com/testing.asan/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
Re: [PATCH 0/3] Add Scripts for Finding Top 25 Executed Functions
Posted by Eric Blake 3 years, 11 months ago
On 6/16/20 6:12 PM, Ahmed Karaman wrote:
> Greetings,
> 
> As a part of the TCG Continous Benchmarking project for GSoC this
> year, detailed reports discussing different performance measurement
> methodologies and analysis results will be sent here on the mailing
> list.
> 
> The project's first report is currently being revised and will be
> posted on the mailing list in the next few days.
> A section in this report will deal with measuring the top 25 executed
> functions when running QEMU. It includes two Python scripts that
> automatically perform this task.
> 
> This series adds these two scripts to a new performance directory
> created under the scripts directory. It also adds a new
> "Miscellaneous" section to the end of the MAINTAINERS file with a
> "Performance Tools and Tests" subsection.
> 
> Best regards,
> Ahmed Karaman
> 
> Ahmed Karaman (3):
>    MAINTAINERS: Add 'Miscellaneous' section
>    scripts/performance: Add callgrind_top_25.py script
>    scripts/performance: Add perf_top_25.py script
> 
>   MAINTAINERS                             |  7 ++
>   scripts/performance/callgrind_top_25.py | 95 +++++++++++++++++++++++++
>   scripts/performance/perf_top_25.py      | 82 +++++++++++++++++++++
>   3 files changed, 184 insertions(+)
>   create mode 100644 scripts/performance/callgrind_top_25.py
>   create mode 100644 scripts/performance/perf_top_25.py

Are the new scripts supposed to have executable permissions, or are they 
always invoked as 'python path/to/script.py' where the executable bit is 
less important?

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org


Re: [PATCH 0/3] Add Scripts for Finding Top 25 Executed Functions
Posted by Alex Bennée 3 years, 11 months ago
Eric Blake <eblake@redhat.com> writes:

> On 6/16/20 6:12 PM, Ahmed Karaman wrote:
>> Greetings,
>> 
>> As a part of the TCG Continous Benchmarking project for GSoC this
>> year, detailed reports discussing different performance measurement
>> methodologies and analysis results will be sent here on the mailing
>> list.
>> 
>> The project's first report is currently being revised and will be
>> posted on the mailing list in the next few days.
>> A section in this report will deal with measuring the top 25 executed
>> functions when running QEMU. It includes two Python scripts that
>> automatically perform this task.
>> 
>> This series adds these two scripts to a new performance directory
>> created under the scripts directory. It also adds a new
>> "Miscellaneous" section to the end of the MAINTAINERS file with a
>> "Performance Tools and Tests" subsection.
>> 
>> Best regards,
>> Ahmed Karaman
>> 
>> Ahmed Karaman (3):
>>    MAINTAINERS: Add 'Miscellaneous' section
>>    scripts/performance: Add callgrind_top_25.py script
>>    scripts/performance: Add perf_top_25.py script
>> 
>>   MAINTAINERS                             |  7 ++
>>   scripts/performance/callgrind_top_25.py | 95 +++++++++++++++++++++++++
>>   scripts/performance/perf_top_25.py      | 82 +++++++++++++++++++++
>>   3 files changed, 184 insertions(+)
>>   create mode 100644 scripts/performance/callgrind_top_25.py
>>   create mode 100644 scripts/performance/perf_top_25.py
>
> Are the new scripts supposed to have executable permissions, or are they 
> always invoked as 'python path/to/script.py' where the executable bit is 
> less important?

I would assume +x for directly invocable scripts - certainly we have a
lot of those in the scripts directory. 

-- 
Alex Bennée

Re: [PATCH 0/3] Add Scripts for Finding Top 25 Executed Functions
Posted by Aleksandar Markovic 3 years, 11 months ago
сре, 17. јун 2020. у 17:34 Alex Bennée <alex.bennee@linaro.org> је написао/ла:
>
>
> Eric Blake <eblake@redhat.com> writes:
>
> > On 6/16/20 6:12 PM, Ahmed Karaman wrote:
> >> Greetings,
> >>
> >> As a part of the TCG Continous Benchmarking project for GSoC this
> >> year, detailed reports discussing different performance measurement
> >> methodologies and analysis results will be sent here on the mailing
> >> list.
> >>
> >> The project's first report is currently being revised and will be
> >> posted on the mailing list in the next few days.
> >> A section in this report will deal with measuring the top 25 executed
> >> functions when running QEMU. It includes two Python scripts that
> >> automatically perform this task.
> >>
> >> This series adds these two scripts to a new performance directory
> >> created under the scripts directory. It also adds a new
> >> "Miscellaneous" section to the end of the MAINTAINERS file with a
> >> "Performance Tools and Tests" subsection.
> >>
> >> Best regards,
> >> Ahmed Karaman
> >>
> >> Ahmed Karaman (3):
> >>    MAINTAINERS: Add 'Miscellaneous' section
> >>    scripts/performance: Add callgrind_top_25.py script
> >>    scripts/performance: Add perf_top_25.py script
> >>
> >>   MAINTAINERS                             |  7 ++
> >>   scripts/performance/callgrind_top_25.py | 95 +++++++++++++++++++++++++
> >>   scripts/performance/perf_top_25.py      | 82 +++++++++++++++++++++
> >>   3 files changed, 184 insertions(+)
> >>   create mode 100644 scripts/performance/callgrind_top_25.py
> >>   create mode 100644 scripts/performance/perf_top_25.py
> >
> > Are the new scripts supposed to have executable permissions, or are they
> > always invoked as 'python path/to/script.py' where the executable bit is
> > less important?
>
> I would assume +x for directly invocable scripts - certainly we have a
> lot of those in the scripts directory.
>

There is no reason IMHO for these scripts not having +x and Ahmed
should correct this in v2, and I think that was his original
intention.

However, I was a little surprized though when I found out this in our
scripts directory:

$ find . -name \*.py -type f  -print | xargs ls -l
-rwxr-xr-x 1 rtrk rtrk  9103 May 10 11:21 ./analyse-9p-simpletrace.py
-rwxr-xr-x 1 rtrk rtrk  3544 May 10 11:21 ./analyse-locks-simpletrace.py
-rwxr-xr-x 1 rtrk rtrk 20647 Jun  2 10:22 ./analyze-migration.py
-rwxr-xr-x 1 rtrk rtrk 38358 Jun  2 10:22 ./decodetree.py
-rw-r--r-- 1 rtrk rtrk 20723 May 10 11:21 ./dump-guest-memory.py
-rwxr-xr-x 1 rtrk rtrk 23599 May 10 11:21 ./minikconf.py
-rw-r--r-- 1 rtrk rtrk  2751 Jun  2 10:22 ./modules/module_block.py
-rw-r--r-- 1 rtrk rtrk  7842 May 10 11:21 ./qapi/commands.py
-rw-r--r-- 1 rtrk rtrk  5673 May 10 11:21 ./qapi/common.py
-rw-r--r-- 1 rtrk rtrk  9742 May 10 11:21 ./qapi/doc.py
-rw-r--r-- 1 rtrk rtrk  1107 May 10 11:21 ./qapi/error.py
-rw-r--r-- 1 rtrk rtrk  6148 May 10 11:21 ./qapi/events.py
-rw-r--r-- 1 rtrk rtrk 12297 May 10 11:21 ./qapi/expr.py
-rwxr-xr-x 1 rtrk rtrk  2066 May 10 11:21 ./qapi-gen.py
-rw-r--r-- 1 rtrk rtrk  8280 May 10 11:21 ./qapi/gen.py
-rw-r--r-- 1 rtrk rtrk     0 May 10 11:21 ./qapi/__init__.py
-rw-r--r-- 1 rtrk rtrk  8533 May 10 11:21 ./qapi/introspect.py
-rw-r--r-- 1 rtrk rtrk 21696 May 10 11:21 ./qapi/parser.py
-rw-r--r-- 1 rtrk rtrk 41301 May 10 11:21 ./qapi/schema.py
-rw-r--r-- 1 rtrk rtrk  1789 May 10 11:21 ./qapi/source.py
-rw-r--r-- 1 rtrk rtrk  8724 May 10 11:21 ./qapi/types.py
-rw-r--r-- 1 rtrk rtrk  9980 May 10 11:21 ./qapi/visit.py
-rw-r--r-- 1 rtrk rtrk  1843 Jun  2 10:22 ./qemugdb/aio.py
-rw-r--r-- 1 rtrk rtrk  3514 Jun  2 10:22 ./qemugdb/coroutine.py
-rw-r--r-- 1 rtrk rtrk   897 Jun  2 10:22 ./qemugdb/__init__.py
-rw-r--r-- 1 rtrk rtrk  2741 Jun  2 10:22 ./qemugdb/mtree.py
-rw-r--r-- 1 rtrk rtrk  1213 Jun  2 10:22 ./qemu-gdb.py
-rw-r--r-- 1 rtrk rtrk  1469 Jun  2 10:22 ./qemugdb/tcg.py
-rw-r--r-- 1 rtrk rtrk  1850 Jun  2 10:22 ./qemugdb/timers.py
-rwxr-xr-x 1 rtrk rtrk  3791 May 10 11:21 ./render_block_graph.py
-rwxr-xr-x 1 rtrk rtrk 12118 May 10 11:21 ./replay-dump.py
-rwxr-xr-x 1 rtrk rtrk  1272 May 10 11:21 ./signrom.py
-rwxr-xr-x 1 rtrk rtrk  3963 May 10 11:21 ./simplebench/bench_block_job.py
-rw-r--r-- 1 rtrk rtrk  2447 May 10 11:21 ./simplebench/bench-example.py
-rw-r--r-- 1 rtrk rtrk  4615 May 10 11:21 ./simplebench/simplebench.py
-rwxr-xr-x 1 rtrk rtrk  8572 May 10 11:21 ./simpletrace.py
-rw-r--r-- 1 rtrk rtrk  1443 May 10 11:21 ./tracetool/backend/dtrace.py
-rw-r--r-- 1 rtrk rtrk  1471 May 10 11:21 ./tracetool/backend/ftrace.py
-rw-r--r-- 1 rtrk rtrk  4098 May 10 11:21 ./tracetool/backend/__init__.py
-rw-r--r-- 1 rtrk rtrk  1499 May 10 11:21 ./tracetool/backend/log.py
-rw-r--r-- 1 rtrk rtrk  3116 May 10 11:21 ./tracetool/backend/simple.py
-rw-r--r-- 1 rtrk rtrk  1175 May 10 11:21 ./tracetool/backend/syslog.py
-rw-r--r-- 1 rtrk rtrk  1190 May 10 11:21 ./tracetool/backend/ust.py
-rw-r--r-- 1 rtrk rtrk  2094 May 10 11:21 ./tracetool/format/c.py
-rw-r--r-- 1 rtrk rtrk  1744 May 10 11:21 ./tracetool/format/d.py
-rw-r--r-- 1 rtrk rtrk  2912 May 10 11:21 ./tracetool/format/h.py
-rw-r--r-- 1 rtrk rtrk  2402 May 10 11:21 ./tracetool/format/__init__.py
-rw-r--r-- 1 rtrk rtrk  3725 May 10 11:21 ./tracetool/format/log_stap.py
-rw-r--r-- 1 rtrk rtrk  2467 May 10 11:21 ./tracetool/format/simpletrace_stap.py
-rw-r--r-- 1 rtrk rtrk  1653 May 10 11:21 ./tracetool/format/stap.py
-rw-r--r-- 1 rtrk rtrk  2388 May 10 11:21 ./tracetool/format/tcg_helper_c.py
-rw-r--r-- 1 rtrk rtrk  1343 May 10 11:21 ./tracetool/format/tcg_helper_h.py
-rw-r--r-- 1 rtrk rtrk  2145 May 10 11:21
./tracetool/format/tcg_helper_wrapper_h.py
-rw-r--r-- 1 rtrk rtrk  2749 May 10 11:21 ./tracetool/format/tcg_h.py
-rw-r--r-- 1 rtrk rtrk   968 May 10 11:21 ./tracetool/format/ust_events_c.py
-rw-r--r-- 1 rtrk rtrk  3678 May 10 11:21 ./tracetool/format/ust_events_h.py
-rw-r--r-- 1 rtrk rtrk 14489 May 10 11:21 ./tracetool/__init__.py
-rwxr-xr-x 1 rtrk rtrk  4525 May 10 11:21 ./tracetool.py
-rw-r--r-- 1 rtrk rtrk  4301 May 10 11:21 ./tracetool/transform.py
-rw-r--r-- 1 rtrk rtrk  2067 May 10 11:21 ./tracetool/vcpu.py
-rwxr-xr-x 1 rtrk rtrk 16117 May 10 11:21 ./vmstate-static-checker.py

$ find . -name \*.pl -type f -print | xargs ls -l
-rwxr-xr-x 1 rtrk rtrk 84694 May 10 11:21 ./checkpatch.pl
-rwxr-xr-x 1 rtrk rtrk  6559 May 10 11:21 ./clean-header-guards.pl
-rwxr-xr-x 1 rtrk rtrk  1396 May 10 11:21 ./cleanup-trace-events.pl
-rwxr-xr-x 1 rtrk rtrk  2725 May 10 11:21 ./disas-objdump.pl
-rwxr-xr-x 1 rtrk rtrk 54645 May 10 11:21 ./get_maintainer.pl
-rwxr-xr-x 1 rtrk rtrk  4289 May 10 11:21 ./hxtool-conv.pl
-rw-r--r-- 1 rtrk rtrk   310 May 10 11:21 ./shaderinclude.pl
-rwxr-xr-x 1 rtrk rtrk  9933 May 10 11:21 ./tap-driver.pl
-rwxr-xr-x 1 rtrk rtrk  3011 May 10 11:21 ./tap-merge.pl
-rwxr-xr-x 1 rtrk rtrk 13657 May 10 11:21 ./texi2pod.pl

Are all these permissions all right?

Thanks,
Aleksandar







> --
> Alex Bennée

Re: [PATCH 0/3] Add Scripts for Finding Top 25 Executed Functions
Posted by Alex Bennée 3 years, 11 months ago
Aleksandar Markovic <aleksandar.qemu.devel@gmail.com> writes:

> сре, 17. јун 2020. у 17:34 Alex Bennée <alex.bennee@linaro.org> је написао/ла:
>>
>>
>> Eric Blake <eblake@redhat.com> writes:
>>
>> > On 6/16/20 6:12 PM, Ahmed Karaman wrote:
>> >> Greetings,
>> >>
>> >> As a part of the TCG Continous Benchmarking project for GSoC this
>> >> year, detailed reports discussing different performance measurement
>> >> methodologies and analysis results will be sent here on the mailing
>> >> list.
>> >>
>> >> The project's first report is currently being revised and will be
>> >> posted on the mailing list in the next few days.
>> >> A section in this report will deal with measuring the top 25 executed
>> >> functions when running QEMU. It includes two Python scripts that
>> >> automatically perform this task.
>> >>
>> >> This series adds these two scripts to a new performance directory
>> >> created under the scripts directory. It also adds a new
>> >> "Miscellaneous" section to the end of the MAINTAINERS file with a
>> >> "Performance Tools and Tests" subsection.
>> >>
>> >> Best regards,
>> >> Ahmed Karaman
>> >>
>> >> Ahmed Karaman (3):
>> >>    MAINTAINERS: Add 'Miscellaneous' section
>> >>    scripts/performance: Add callgrind_top_25.py script
>> >>    scripts/performance: Add perf_top_25.py script
>> >>
>> >>   MAINTAINERS                             |  7 ++
>> >>   scripts/performance/callgrind_top_25.py | 95 +++++++++++++++++++++++++
>> >>   scripts/performance/perf_top_25.py      | 82 +++++++++++++++++++++
>> >>   3 files changed, 184 insertions(+)
>> >>   create mode 100644 scripts/performance/callgrind_top_25.py
>> >>   create mode 100644 scripts/performance/perf_top_25.py
>> >
>> > Are the new scripts supposed to have executable permissions, or are they
>> > always invoked as 'python path/to/script.py' where the executable bit is
>> > less important?
>>
>> I would assume +x for directly invocable scripts - certainly we have a
>> lot of those in the scripts directory.
>>
>
> There is no reason IMHO for these scripts not having +x and Ahmed
> should correct this in v2, and I think that was his original
> intention.
>
> However, I was a little surprized though when I found out this in our
> scripts directory:
>
> $ find . -name \*.py -type f  -print | xargs ls -l
<snip>
> -rw-r--r-- 1 rtrk rtrk 20723 May 10 11:21 ./dump-guest-memory.py
> -rw-r--r-- 1 rtrk rtrk  2751 Jun  2 10:22 ./modules/module_block.py
> -rw-r--r-- 1 rtrk rtrk  7842 May 10 11:21 ./qapi/commands.py
> -rw-r--r-- 1 rtrk rtrk  5673 May 10 11:21 ./qapi/common.py
> -rw-r--r-- 1 rtrk rtrk  9742 May 10 11:21 ./qapi/doc.py
> -rw-r--r-- 1 rtrk rtrk  1107 May 10 11:21 ./qapi/error.py
> -rw-r--r-- 1 rtrk rtrk  6148 May 10 11:21 ./qapi/events.py
> -rw-r--r-- 1 rtrk rtrk 12297 May 10 11:21 ./qapi/expr.py
> -rw-r--r-- 1 rtrk rtrk  8280 May 10 11:21 ./qapi/gen.py
> -rw-r--r-- 1 rtrk rtrk     0 May 10 11:21 ./qapi/__init__.py
> -rw-r--r-- 1 rtrk rtrk  8533 May 10 11:21 ./qapi/introspect.py
> -rw-r--r-- 1 rtrk rtrk 21696 May 10 11:21 ./qapi/parser.py
> -rw-r--r-- 1 rtrk rtrk 41301 May 10 11:21 ./qapi/schema.py
> -rw-r--r-- 1 rtrk rtrk  1789 May 10 11:21 ./qapi/source.py
> -rw-r--r-- 1 rtrk rtrk  8724 May 10 11:21 ./qapi/types.py
> -rw-r--r-- 1 rtrk rtrk  9980 May 10 11:21 ./qapi/visit.py
> -rw-r--r-- 1 rtrk rtrk  1843 Jun  2 10:22 ./qemugdb/aio.py
> -rw-r--r-- 1 rtrk rtrk  3514 Jun  2 10:22 ./qemugdb/coroutine.py
> -rw-r--r-- 1 rtrk rtrk   897 Jun  2 10:22 ./qemugdb/__init__.py
> -rw-r--r-- 1 rtrk rtrk  2741 Jun  2 10:22 ./qemugdb/mtree.py
> -rw-r--r-- 1 rtrk rtrk  1213 Jun  2 10:22 ./qemu-gdb.py
> -rw-r--r-- 1 rtrk rtrk  1469 Jun  2 10:22 ./qemugdb/tcg.py
> -rw-r--r-- 1 rtrk rtrk  1850 Jun  2 10:22 ./qemugdb/timers.py
> -rw-r--r-- 1 rtrk rtrk  2447 May 10 11:21 ./simplebench/bench-example.py
> -rw-r--r-- 1 rtrk rtrk  4615 May 10 11:21 ./simplebench/simplebench.py
> -rw-r--r-- 1 rtrk rtrk  1443 May 10 11:21 ./tracetool/backend/dtrace.py
> -rw-r--r-- 1 rtrk rtrk  1471 May 10 11:21 ./tracetool/backend/ftrace.py
> -rw-r--r-- 1 rtrk rtrk  4098 May 10 11:21 ./tracetool/backend/__init__.py
> -rw-r--r-- 1 rtrk rtrk  1499 May 10 11:21 ./tracetool/backend/log.py
> -rw-r--r-- 1 rtrk rtrk  3116 May 10 11:21 ./tracetool/backend/simple.py
> -rw-r--r-- 1 rtrk rtrk  1175 May 10 11:21 ./tracetool/backend/syslog.py
> -rw-r--r-- 1 rtrk rtrk  1190 May 10 11:21 ./tracetool/backend/ust.py
> -rw-r--r-- 1 rtrk rtrk  2094 May 10 11:21 ./tracetool/format/c.py
> -rw-r--r-- 1 rtrk rtrk  1744 May 10 11:21 ./tracetool/format/d.py
> -rw-r--r-- 1 rtrk rtrk  2912 May 10 11:21 ./tracetool/format/h.py
> -rw-r--r-- 1 rtrk rtrk  2402 May 10 11:21 ./tracetool/format/__init__.py
> -rw-r--r-- 1 rtrk rtrk  3725 May 10 11:21 ./tracetool/format/log_stap.py
> -rw-r--r-- 1 rtrk rtrk  2467 May 10 11:21 ./tracetool/format/simpletrace_stap.py
> -rw-r--r-- 1 rtrk rtrk  1653 May 10 11:21 ./tracetool/format/stap.py
> -rw-r--r-- 1 rtrk rtrk  2388 May 10 11:21 ./tracetool/format/tcg_helper_c.py
> -rw-r--r-- 1 rtrk rtrk  1343 May 10 11:21 ./tracetool/format/tcg_helper_h.py
> -rw-r--r-- 1 rtrk rtrk  2145 May 10 11:21
> ./tracetool/format/tcg_helper_wrapper_h.py
> -rw-r--r-- 1 rtrk rtrk  2749 May 10 11:21 ./tracetool/format/tcg_h.py
> -rw-r--r-- 1 rtrk rtrk   968 May 10 11:21 ./tracetool/format/ust_events_c.py
> -rw-r--r-- 1 rtrk rtrk  3678 May 10 11:21 ./tracetool/format/ust_events_h.py
> -rw-r--r-- 1 rtrk rtrk 14489 May 10 11:21 ./tracetool/__init__.py
> -rw-r--r-- 1 rtrk rtrk  4301 May 10 11:21 ./tracetool/transform.py
> -rw-r--r-- 1 rtrk rtrk  2067 May 10 11:21 ./tracetool/vcpu.py

So I think these are all modules or loaded indirectly (in the case of
the gdb helpers). There was a big clean-up recently removing the
#!/bin/env python headers from a chunk of these.

<snip>
> -rw-r--r-- 1 rtrk rtrk   310 May 10 11:21 ./shaderinclude.pl

Arguably this could be +x but it seems to be there for the benefit of
the make system which explicitly calls perl anyway.

>
> Are all these permissions all right?

I think so.

-- 
Alex Bennée

Re: [PATCH 0/3] Add Scripts for Finding Top 25 Executed Functions
Posted by Ahmed Karaman 3 years, 11 months ago
On Wed, Jun 17, 2020 at 3:53 PM Eric Blake <eblake@redhat.com> wrote:
> Are the new scripts supposed to have executable permissions, or are they
> always invoked as 'python path/to/script.py' where the executable bit is
> less important?
>
> --
> Eric Blake, Principal Software Engineer
> Red Hat, Inc.           +1-919-301-3226
> Virtualization:  qemu.org | libvirt.org
>
The execution permission will be added to the scripts in v2 of this
series. There will be no need to invoke them with Python when this is
done.