Incorrect operand type in google server workload traces

6 views
Skip to first unread message

York Ma

unread,
Dec 12, 2025, 4:57:59 AM (5 days ago) Dec 12
to DynamoRIO Users
Hi,

I am investigating register operand dependencies in the google server workload
traces.
It seems that the trace records (memref_t) are successfully decoded into instr_t
and x86 register IDs are obtained.
However, the operand type does not make sense: most of the destination operands
(also the 2nd source operand) appear to be memory references but I think most of
them should be register operands.
I am wondering whether there is some bugs in my decoding process or in the
generated trace.

Here's my code to decode operands (opnd_t).
    auto decode_operand = [](opnd_t opd) -> Operand {
        Operand opd_rec;
        if (opnd_is_memory_reference(opd)) {
            opd_rec.type = OperandType::Memory;
            opd_rec.base_reg = opnd_get_base(opd);
            opd_rec.index_reg = opnd_get_index(opd);
            opd_rec.displacement = opnd_get_disp(opd);
        }
        else if (opnd_is_immed(opd)) {
            opd_rec.type = OperandType::Immediate;
        }
        else if (opnd_is_reg(opd)) {
            opd_rec.type = OperandType::Register;
            opd_rec.regid = opnd_get_reg(opd);
        }
        else {
            opd_rec.type = OperandType::Others;
        }
        return opd_rec;
    };
And the attached figure is the decoded trace records.
trace_records.png
Register operands are show as reg:<reg_name> and memory references are shown as
mem:<base_reg>:<index_reg>:<offset>.
The log is from decoding the four traces (from delta) (via the scheduler):
13110814307995660531.636438.memtrace.zip
13110814307995660531.636440.memtrace.zip
13110814307995660531.636439.memtrace.zip
13110814307995660531.636441.memtrace.zip

The trace looks make sense if we ignore the operand type.
Most of instructions have two source operands and one source is also the
destination.
The instructions frequently use registers RAX, RCX, RDX, or RBX.
All these features match what I expected from an x86 instruction trace.
But the operand type of the destination operand (and also the 2nd source operand)
looks not correct.
The log shows that most of the destinations are memory references.
However, I think most of them are simply register operands since the underlying
instruction record is not followed by a memory record.
Am I decode the operands in a correct way?

Kai Luk

unread,
Dec 12, 2025, 12:22:03 PM (4 days ago) Dec 12
to York Ma, DynamoRIO Users

--
You received this message because you are subscribed to the Google Groups "DynamoRIO Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dynamorio-use...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dynamorio-users/232434b7-8105-4de5-bd0f-eb0bd437cbf5n%40googlegroups.com.

Derek Bruening

unread,
Dec 12, 2025, 1:47:24 PM (4 days ago) Dec 12
to Kai Luk, York Ma, DynamoRIO Users
Use the view tool for a human-readable view of the virtual registers used by each instruction.
For a new tool, as documented, use the decode_cache_t library which does the heavy lifting for you.

Reply all
Reply to author
Forward
0 new messages