Skip to content

BUG: Pahole does not create reorganization steps if structure is very large to analyze. #66

@GermanAizek

Description

@GermanAizek

@acmel, @alan-maguire,
bug preventing use pahole tool

$ ~/GIT/dwarves/build/pahole --reorganize -S --class_name=Dav1dFrameContext -j72 */*/*.o
libbpf: failed to find '.BTF' ELF section in src/libdav1d_bitdepth_16.a.p/cdef_apply_tmpl.c.o
pahole: src/libdav1d_bitdepth_16.a.p/cdef_apply_tmpl.c.o: Invalid argument

without class_name param

$ ~/GIT/dwarves/build/pahole --reorganize -S -j72 */*/*.o
struct Dav1dFrameContext {
        Dav1dRef *                 seq_hdr_ref;          /*     0     8 */
        Dav1dSequenceHeader *      seq_hdr;              /*     8     8 */
        Dav1dRef *                 frame_hdr_ref;        /*    16     8 */
        Dav1dFrameHeader *         frame_hdr;            /*    24     8 */
        Dav1dThreadPicture         refp[7];              /*    32  2072 */
        /* --- cacheline 32 boundary (2048 bytes) was 56 bytes ago --- */
        Dav1dPicture               cur;                  /*  2104   272 */
        /* --- cacheline 37 boundary (2368 bytes) was 8 bytes ago --- */
        Dav1dThreadPicture         sr_cur;               /*  2376   296 */
        /* --- cacheline 41 boundary (2624 bytes) was 48 bytes ago --- */
        Dav1dRef *                 mvs_ref;              /*  2672     8 */
        refmvs_temporal_block *    mvs;                  /*  2680     8 */
        /* --- cacheline 42 boundary (2688 bytes) --- */
        refmvs_temporal_block *    ref_mvs[7];           /*  2688    56 */
        Dav1dRef *                 ref_mvs_ref[7];       /*  2744    56 */
        /* --- cacheline 43 boundary (2752 bytes) was 48 bytes ago --- */
        Dav1dRef *                 cur_segmap_ref;       /*  2800     8 */
        Dav1dRef *                 prev_segmap_ref;      /*  2808     8 */
        /* --- cacheline 44 boundary (2816 bytes) --- */
        uint8_t *                  cur_segmap;           /*  2816     8 */
        const uint8_t  *           prev_segmap;          /*  2824     8 */
        unsigned int               refpoc[7];            /*  2832    28 */
        unsigned int               refrefpoc[7][7];      /*  2860   196 */
        /* --- cacheline 47 boundary (3008 bytes) was 48 bytes ago --- */
        CdfThreadContext           in_cdf;               /*  3056    24 */
        /* --- cacheline 48 boundary (3072 bytes) was 8 bytes ago --- */
        CdfThreadContext           out_cdf;              /*  3080    24 */
        struct Dav1dTileGroup *    tile;                 /*  3104     8 */
        int                        n_tile_data_alloc;    /*  3112     4 */
        int                        n_tile_data;          /*  3116     4 */
        uint8_t                    gmv_warp_allowed[7];  /*  3120     7 */

        /* XXX 1 byte hole, try to pack */

        const Dav1dContext  *      c;                    /*  3128     8 */
        /* --- cacheline 49 boundary (3136 bytes) --- */
        Dav1dTileState *           ts;                   /*  3136     8 */
        const Dav1dDSPContext  *   dsp;                  /*  3144     8 */
        struct {
                recon_b_intra_fn   recon_b_intra;        /*  3152     8 */
                recon_b_inter_fn   recon_b_inter;        /*  3160     8 */
                filter_sbrow_fn    filter_sbrow;         /*  3168     8 */
                filter_sbrow_fn    filter_sbrow_deblock_cols; /*  3176     8 */
                filter_sbrow_fn    filter_sbrow_deblock_rows; /*  3184     8 */
                void               (*filter_sbrow_cdef)(Dav1dTaskContext *, int); /*  3192     8 */
                /* --- cacheline 50 boundary (3200 bytes) --- */
                filter_sbrow_fn    filter_sbrow_resize;  /*  3200     8 */
                filter_sbrow_fn    filter_sbrow_lr;      /*  3208     8 */
                backup_ipred_edge_fn backup_ipred_edge;  /*  3216     8 */
                read_coef_blocks_fn read_coef_blocks;    /*  3224     8 */
                copy_pal_block_fn  copy_pal_block_y;     /*  3232     8 */
                copy_pal_block_fn  copy_pal_block_uv;    /*  3240     8 */
                read_pal_plane_fn  read_pal_plane;       /*  3248     8 */
                read_pal_uv_fn     read_pal_uv;          /*  3256     8 */
        } bd_fn;                                         /*  3152   112 */
        /* --- cacheline 51 boundary (3264 bytes) --- */
        int                        n_ts;                 /*  3264     4 */
        int                        ipred_edge_sz;        /*  3268     4 */
        pixel *                    ipred_edge[3];        /*  3272    24 */
        ptrdiff_t                  b4_stride;            /*  3296     8 */
        int                        w4;                   /*  3304     4 */
        int                        h4;                   /*  3308     4 */
        int                        bw;                   /*  3312     4 */
        int                        bh;                   /*  3316     4 */
        int                        sb128w;               /*  3320     4 */
        int                        sb128h;               /*  3324     4 */
        /* --- cacheline 52 boundary (3328 bytes) --- */
        int                        sbh;                  /*  3328     4 */
        int                        sb_shift;             /*  3332     4 */
        int                        sb_step;              /*  3336     4 */
        int                        sr_sb128w;            /*  3340     4 */
        uint16_t                   dq[8][3][2];          /*  3344    96 */
        /* --- cacheline 53 boundary (3392 bytes) was 48 bytes ago --- */
        const uint8_t  *           qm[19][3];            /*  3440   456 */
        /* --- cacheline 60 boundary (3840 bytes) was 56 bytes ago --- */
        BlockContext *             a;                    /*  3896     8 */
        /* --- cacheline 61 boundary (3904 bytes) --- */
        int                        a_sz;                 /*  3904     4 */

        /* XXX 4 bytes hole, try to pack */

        refmvs_frame               rf;                   /*  3912   208 */
        /* --- cacheline 64 boundary (4096 bytes) was 24 bytes ago --- */
        uint8_t                    jnt_weights[7][7];    /*  4120    49 */

        /* XXX 3 bytes hole, try to pack */

        /* --- cacheline 65 boundary (4160 bytes) was 12 bytes ago --- */
        int                        bitdepth_max;         /*  4172     4 */
        struct ScalableMotionParams svc[7][2];           /*  4176   112 */
        /* --- cacheline 67 boundary (4288 bytes) --- */
        int                        resize_step[2];       /*  4288     8 */
        int                        resize_start[2];      /*  4296     8 */
        struct {
                int                next_tile_row[2];     /*  4304     8 */
                atomic_int         entropy_progress;     /*  4312     4 */
                atomic_int         deblock_progress;     /*  4316     4 */
                atomic_uint *      frame_progress;       /*  4320     8 */
                atomic_uint *      copy_lpf_progress;    /*  4328     8 */
                Av1Block *         b;                    /*  4336     8 */
                int16_t *          cbi;                  /*  4344     8 */
                /* --- cacheline 68 boundary (4352 bytes) --- */
                pixel *            pal;                  /*  4352     8 */
                uint8_t *          pal_idx;              /*  4360     8 */
                coef *             cf;                   /*  4368     8 */
                int                prog_sz;              /*  4376     4 */
                int                cbi_sz;               /*  4380     4 */
                int                pal_sz;               /*  4384     4 */
                int                pal_idx_sz;           /*  4388     4 */
                int                cf_sz;                /*  4392     4 */

                /* XXX 4 bytes hole, try to pack */

                unsigned int *     tile_start_off;       /*  4400     8 */
        } frame_thread;                                  /*  4304   104 */

        /* XXX last struct has 1 hole */
        /* XXX 8 bytes hole, try to pack */

        /* --- cacheline 69 boundary (4416 bytes) --- */
        struct {
                uint8_t *          level;                /*  4416     8 */
                Av1Filter *        mask;                 /*  4424     8 */
                Av1Restoration *   lr_mask;              /*  4432     8 */
                int                mask_sz;              /*  4440     4 */
                int                lr_mask_sz;           /*  4444     4 */
                int                cdef_buf_plane_sz[2]; /*  4448     8 */
                int                cdef_buf_sbh;         /*  4456     4 */
                int                lr_buf_plane_sz[2];   /*  4460     8 */
                int                re_sz;                /*  4468     4 */

                /* XXX 8 bytes hole, try to pack */

                /* --- cacheline 70 boundary (4480 bytes) --- */
                Av1FilterLUT       lim_lut __attribute__((__aligned__(16))); /*  4480   144 */
                /* --- cacheline 72 boundary (4608 bytes) was 16 bytes ago --- */
                uint8_t            lvl[8][4][8][2] __attribute__((__aligned__(16))); /*  4624   512 */
                /* --- cacheline 80 boundary (5120 bytes) was 16 bytes ago --- */
                int                last_sharpness;       /*  5136     4 */

                /* XXX 4 bytes hole, try to pack */

                uint8_t *          tx_lpf_right_edge[2]; /*  5144    16 */
                uint8_t *          cdef_line_buf;        /*  5160     8 */
                uint8_t *          lr_line_buf;          /*  5168     8 */
                pixel *            cdef_line[2][3];      /*  5176    48 */
                /* --- cacheline 81 boundary (5184 bytes) was 40 bytes ago --- */
                pixel *            cdef_lpf_line[3];     /*  5224    24 */
                /* --- cacheline 82 boundary (5248 bytes) --- */
                pixel *            lr_lpf_line[3];       /*  5248    24 */
                uint8_t *          start_of_tile_row;    /*  5272     8 */
                int                start_of_tile_row_sz; /*  5280     4 */
                int                need_cdef_lpf_copy;   /*  5284     4 */
                pixel *            p[3];                 /*  5288    24 */
                /* --- cacheline 83 boundary (5312 bytes) --- */
                pixel *            sr_p[3];              /*  5312    24 */
                int                restore_planes;       /*  5336     4 */
        } __attribute__((__aligned__(16))) lf __attribute__((__aligned__(16)));           /*  4416   928 */

        /* XXX last struct has 4 bytes of padding, 2 holes */

        struct {
                pthread_mutex_t    lock;                 /*  5344    40 */
                /* --- cacheline 84 boundary (5376 bytes) was 8 bytes ago --- */
                pthread_cond_t     cond;                 /*  5384    48 */
                struct TaskThreadData * ttd;             /*  5432     8 */
                /* --- cacheline 85 boundary (5440 bytes) --- */
                struct Dav1dTask * tasks;                /*  5440     8 */
                struct Dav1dTask * tile_tasks[2];        /*  5448    16 */
                struct Dav1dTask   init_task;            /*  5464    32 */
                int                num_tasks;            /*  5496     4 */
                int                num_tile_tasks;       /*  5500     4 */
                /* --- cacheline 86 boundary (5504 bytes) --- */
                atomic_int         init_done;            /*  5504     4 */
                atomic_int         done[2];              /*  5508     8 */
                int                retval;               /*  5516     4 */
                int                update_set;           /*  5520     4 */
                atomic_int         error;                /*  5524     4 */
                atomic_int         task_counter;         /*  5528     4 */

                /* XXX 4 bytes hole, try to pack */

                struct Dav1dTask * task_head;            /*  5536     8 */
                struct Dav1dTask * task_tail;            /*  5544     8 */
                struct Dav1dTask * task_cur_prev;        /*  5552     8 */
                struct {
                        atomic_int merge;                /*  5560     4 */

                        /* XXX 4 bytes hole, try to pack */

                        /* --- cacheline 87 boundary (5568 bytes) --- */
                        pthread_mutex_t lock;            /*  5568    40 */
                        Dav1dTask * head;                /*  5608     8 */
                        Dav1dTask * tail;                /*  5616     8 */
                } pending_tasks;                         /*  5560    64 */

                /* XXX last struct has 1 hole */
        } task_thread;                                   /*  5344   280 */

        /* XXX last struct has 1 hole */

        struct FrameTileThreadData tile_thread;          /*  5624    16 */

        /* XXX last struct has 4 bytes of padding */

        /* size: 5648, cachelines: 89, members: 55 */
        /* sum members: 5624, holes: 4, sum holes: 16 */
        /* padding: 8 */
        /* member types with holes: 3, total: 4 */
        /* paddings: 2, sum paddings: 8 */
        /* forced alignments: 1, forced holes: 1, sum forced holes: 8 */
        /* last cacheline: 16 bytes */
} __attribute__((__aligned__(16)));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions