lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <41682f40-3b5e-e21c-d75e-f57f8f3310da@collabora.com>
Date:   Tue, 22 Jun 2021 14:23:08 +0200
From:   Benjamin Gaignard <benjamin.gaignard@...labora.com>
To:     Ezequiel Garcia <ezequiel@...labora.com>, hverkuil@...all.nl,
        p.zabel@...gutronix.de, mchehab@...nel.org, shawnguo@...nel.org,
        s.hauer@...gutronix.de, festevam@...il.com,
        gregkh@...uxfoundation.org, mripard@...nel.org,
        paul.kocialkowski@...tlin.com, wens@...e.org,
        jernej.skrabec@...l.net, emil.l.velikov@...il.com,
        andrzej.p@...labora.com, jc@...esim.co.uk,
        jernej.skrabec@...il.com, nicolas@...fresne.ca
Cc:     kernel@...gutronix.de, linux-imx@....com,
        linux-media@...r.kernel.org, linux-rockchip@...ts.infradead.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 1/8] media: hantro: Trace hevc hw cycles performance
 register


Le 18/06/2021 à 20:58, Ezequiel Garcia a écrit :
> Hi Benjamin,
>
> On Fri, 2021-06-18 at 15:15 +0200, Benjamin Gaignard wrote:
>> After each hevc decoded frame trace the hardware performance.
>> It provides the number of hw cycles spend per decoded macroblock.
>>
> Please add some documentation about how these are supposed
> to be used. It will be easier to discuss after seeing
> things in actiion.
>
> A good place for the documentation would be:
>
> https://www.kernel.org/doc/html/latest/admin-guide/media/v4l-drivers.html

Ok that will be in v4

>
> [..]
>> @@ -22,6 +23,21 @@ static inline void hantro_write_addr(struct hantro_dev *vpu,
>>          vdpu_write(vpu, addr & 0xffffffff, offset);
>>   }
>>   
>> +void hantro_g2_hevc_dec_done(struct hantro_ctx *ctx)
> I'm worried about the runtime cost this would have.
>
> I see other drivers (i915, panfrost) seem to have an ioctl
> to enable the perf counters.
>
> Perhaps we don't need an ioctl, but a module param would be enough
> for now.

You can be reassured the overhead of traces points is very low has explained
in this article: https://lwn.net/Articles/330402/

>
>> +{
>> +       const struct hantro_hevc_dec_ctrls *ctrls = &ctx->hevc_dec.ctrls;
>> +       const struct v4l2_ctrl_hevc_sps *sps = ctrls->sps;
>> +       struct hantro_dev *vpu = ctx->dev;
>> +       u32 hw_cycles = 0;
>> +       u32 mbs = (sps->pic_width_in_luma_samples *
>> +                  sps->pic_height_in_luma_samples) >> 8;
>> +
>> +       if (mbs)
>> +               hw_cycles = vdpu_read(vpu, G2_HW_PERFORMANCE) / mbs;
>> +
>> +       trace_hantro_hevc_perf(ctx, hw_cycles);
>> +}
>> +
>>
> [..]
>> +
>> +TRACE_EVENT(hantro_hevc_perf,
>> +       TP_PROTO(struct hantro_ctx *ctx, u32 hw_cycles),
>> +
>> +       TP_ARGS(ctx, hw_cycles),
>> +
>> +       TP_STRUCT__entry(
>> +               __field(int, minor)
>> +               __field(u32, hw_cycles)
>> +       ),
>> +
>> +       TP_fast_assign(
>> +               __entry->minor = ctx->fh.vdev->minor;
> Tracking performance per minor doesn't seem useful,
> we'd like to track per-fd (i.e. per context).

This part of the driver doesn't know for which fd the decoding job is done
so impossible to add it there.

Regards,
Benjamin

>
> Thanks,
> Ezequiel
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ