Skip to content
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

There's problem with sampling summary when --sample-display-row is used #53

Open
PrzemekWirkus opened this issue Oct 25, 2024 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers
Milestone

Comments

@PrzemekWirkus
Copy link
Collaborator

PrzemekWirkus commented Oct 25, 2024

Description

With --sample-display-row flag set, we can see that sampling "total" summary is "shifted" under "sample source" line and above sampling symbols list:

======================== sample source: ld_spec, top 5 hot functions ========================
           93.75%  1200  top 5 in total
        overhead  count  symbol
        ========  =====  ======
           80.86   1035  static struct _longobject * x_mul(struct _longobject *, struct _longobject *):python312_d.dll

For above 93.75% 1200 top 5 in total should be under symbol list. See example below with full listing of the example sampling with and without troublesome flag.

Example

>wperf record -e ld_spec:100000 -c 1 --sample-display-row 5  --sample-display-long --timeout 30 -- cpython\PCbuild\arm64\python_d.exe -c 10**10**100
base address of 'cpython\PCbuild\arm64\python_d.exe': 0x7ff765fe1288, runtime delta: 0x7ff625fe0000
sampling .....e..e..e..e..e done!
======================== sample source: ld_spec, top 5 hot functions ========================
           93.75%  1200  top 5 in total
        overhead  count  symbol
        ========  =====  ======
           80.86   1035  static struct _longobject * x_mul(struct _longobject *, struct _longobject *):python312_d.dll
            5.08     65  static unsigned int v_isub(unsigned int *, __int64, unsigned int *, __int64):python312_d.dll
            3.52     45  _Py_atomic_load_32bit_impl:python312_d.dll
            2.19     28  static unsigned int v_iadd(unsigned int *, __int64, unsigned int *, __int64):python312_d.dll
            2.11     27  PyErr_CheckSignals:python312_d.dll

              17.297 seconds time elapsed
>wperf record -e ld_spec:100000 -c 1 --sample-display-long --timeout 30 -- cpython\PCbuild\arm64\python_d.exe -c 10**10**100
base address of 'cpython\PCbuild\arm64\python_d.exe': 0x7ff765fe1288, runtime delta: 0x7ff625fe0000
sampling .....e..e..e..e..e done!
======================== sample source: ld_spec, top 50 hot functions ========================
        overhead  count  symbol
        ========  =====  ======
           77.89    997  static struct _longobject * x_mul(struct _longobject *, struct _longobject *):python312_d.dll
            4.69     60  static unsigned int v_isub(unsigned int *, __int64, unsigned int *, __int64):python312_d.dll
            4.38     56  _Py_atomic_load_32bit_impl:python312_d.dll
            3.28     42  static unsigned int v_iadd(unsigned int *, __int64, unsigned int *, __int64):python312_d.dll
            2.66     34  PyErr_CheckSignals:python312_d.dll
            2.03     26  unknown
            1.41     18  static struct _longobject * x_add(struct _longobject *, struct _longobject *):python312_d.dll
            0.78     10  _Py_atomic_load_64bit_impl:python312_d.dll
            0.62      8  static int _Py_ThreadCanHandleSignals(struct _is *):python312_d.dll
            0.55      7  static unsigned __int64 read_size_t(const void *):python312_d.dll
            0.31      4  static void _PyMem_DebugCheckAddress(const char *, char, const void *):python312_d.dll
            0.31      4  _PyErr_CheckSignalsTstate:python312_d.dll
            0.16      2  static void _Py_DECREF_SPECIALIZED(struct _object *,  *):python312_d.dll
            0.16      2  static void write_size_t(void *, unsigned __int64):python312_d.dll
            0.16      2  static struct _longobject * k_mul(struct _longobject *, struct _longobject *):python312_d.dll
            0.16      2  static struct _longobject * long_normalize(struct _longobject *):python312_d.dll
            0.08      1  static void _PyObject_Init(struct _object *, struct _typeobject *):python312_d.dll
            0.08      1  _PyMem_DebugRawFree:python312_d.dll
            0.08      1  static void * _PyMem_DebugRawAlloc(int, void *, unsigned __int64):python312_d.dll
            0.08      1  _PyMem_RawFree:python312_d.dll
            0.08      1  _PyMem_DebugMalloc:python312_d.dll
            0.08      1  static struct _ts * tstate_tss_get(struct _Py_tss_t *):python312_d.dll
          100.00%  1280  top 22 in total

              17.053 seconds time elapsed
@PrzemekWirkus PrzemekWirkus added bug Something isn't working good first issue Good for newcomers labels Oct 25, 2024
@PrzemekWirkus PrzemekWirkus added this to the v4.0.0 milestone Oct 25, 2024
@PrzemekWirkus PrzemekWirkus changed the title There's problem with sampling summary when --sample-display-row is used. There's problem with sampling summary when --sample-display-row is used Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant