[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 52/55] plugins: make howvec plugin more generic
From: |
Alex Bennée |
Subject: |
Re: [PATCH v5 52/55] plugins: make howvec plugin more generic |
Date: |
Mon, 14 Oct 2019 18:14:23 +0100 |
User-agent: |
mu4e 1.3.5; emacs 27.0.50 |
Richard Henderson <address@hidden> writes:
> On 10/14/19 3:49 AM, Alex Bennée wrote:
>> @@ -190,14 +211,18 @@ static uint64_t * find_counter(struct qemu_plugin_insn
>> *insn)
>> uint32_t opcode;
>> InsnClassExecCount *class = NULL;
>>
>> - /* we expect all instructions to by 32 bits for ARM */
>> - g_assert(qemu_plugin_insn_size(insn) == 4);
>> + /*
>> + * We only match the first 32 bits of the instruction which is
>> + * fine for most RISCs but a bit limiting for CISC architectures.
>> + * They would probably benefit from a more tailored plugin.
>> + * However we can fall back to individual instruction counting.
>> + */
>> opcode = *((uint32_t *)qemu_plugin_insn_data(insn));
>
> This totally ignores the endianness of the host.
> I'm not keen on reading more than the number of
> bytes in the insn either...
I guess we can strncpy the data and ensure it is NULL terminated and use
the "string" hash function instead. It depends if there are many opcode
strings with NULL's in them.
>
>
> r~
--
Alex Bennée
- [PATCH v5 49/55] accel/stubs: reduce headers from tcg-stub, (continued)
- [PATCH v5 49/55] accel/stubs: reduce headers from tcg-stub, Alex Bennée, 2019/10/14
- [PATCH v5 43/55] tests/tcg: drop test-i386-fprem from TESTS when not SLOW, Alex Bennée, 2019/10/14
- [PATCH v5 08/55] plugin: add core code, Alex Bennée, 2019/10/14
- [PATCH v5 54/55] plugins: add qemu_plugin_outs and use it, Alex Bennée, 2019/10/14
- [PATCH v5 33/55] target/xtensa: fetch code with translator_ld, Alex Bennée, 2019/10/14
- [PATCH v5 46/55] plugin: add qemu_plugin_insn_disas helper, Alex Bennée, 2019/10/14
- [PATCH v5 52/55] plugins: make howvec plugin more generic, Alex Bennée, 2019/10/14
- [PATCH v5 31/55] target/riscv: fetch code with translator_ld, Alex Bennée, 2019/10/14
- [PATCH v5 17/55] plugins: implement helpers for resolving hwaddr, Alex Bennée, 2019/10/14
[PATCH v5 32/55] target/sparc: fetch code with translator_ld, Alex Bennée, 2019/10/14