On 8/22/2022 3:18 PM, Steven Rostedt wrote:
On Mon, 22 Aug 2022 14:48:30 -0700 Dave Jiang <dave.jiang@xxxxxxxxx> wrote:Attempting to use libtraceevent to retrieve fields from events. For example here's the event I'm trying to parse: check-events.sh-5983 [002] ..... 261848.250238: cxl_dram_event: cxl_mem.7: Fatal time=0 id=b3cb1 d60-069c-ab4e-b8af-4e9bfb5c9624 handle=1 related_handle=0 hdr_flags='Performance Degraded': phys_add r=8000 volatile=FALSE desc='Threshold event' type='Invalid Address' trans_type='Internal Media Scrub ' channel=1 rank=0 nibble_mask=0 bank_group=5 bank=2 row=0 column=1024 cor_mask=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 valid_flags='CHANNEL|BANK GROUP|BANK|COLUMN' Here's me iterating through all the fields and using tep_get_field_raw() trying to retrieve the fields. It appears that if the field is a string type I'm not able to retrieve the field and the error written back in the seq file is "CANT FIND FIELD". Am I doing something wrong or using the wrong API to retrieve those type of fields?What's the format for this event? That is, what is the output of : trace-cmd list -e cxl_dram_event -F ?
#trace-cmd list -e cxl_dram_event -F system: cxl_events name: cxl_dram_event ID: 2325 format: field:unsigned short common_type; offset:0; size:2; signed:0; field:unsigned char common_flags; offset:2; size:1; signed:0; field:unsigned char common_preempt_count; offset:3; size:1; signed:0; field:int common_pid; offset:4; size:4; signed:1; field:__data_loc char[] dev_name; offset:8; size:4; signed:1; field:int log; offset:12; size:4; signed:1; field:u8 id[16]; offset:16; size:16; signed:0; field:u32 flags; offset:32; size:4; signed:0; field:u16 handle; offset:36; size:2; signed:0; field:u16 related_handle; offset:38; size:2; signed:0; field:u64 timestamp; offset:40; size:8; signed:0; field:u64 phys_addr; offset:48; size:8; signed:0; field:u8 descriptor; offset:56; size:1; signed:0; field:u8 type; offset:57; size:1; signed:0; field:u8 transaction_type; offset:58; size:1; signed:0; field:u8 channel; offset:59; size:1; signed:0; field:u16 validity_flags; offset:60; size:2; signed:0; field:u16 column; offset:62; size:2; signed:0; field:u32 nibble_mask; offset:64; size:4; signed:0; field:u32 row; offset:68; size:4; signed:0; field:u8 cor_mask[0x20]; offset:72; size:32; signed:0; field:u8 rank; offset:104; size:1; signed:0; field:u8 bank_group; offset:105; size:1; signed:0; field:u8 bank; offset:106; size:1; signed:0;
As what gets show in the output may not actually match the fields that are saved in the raw event. -- Steve