Return-Path: Date: Mon, 19 Jan 2015 13:59:34 +0100 From: Jiri Olsa Message-ID: <20150119125934.GA17369@krava.brq.redhat.com> References: <54BCF494.8050808@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <54BCF494.8050808@huawei.com> Subject: Re: [diamon-discuss] [BUG] perf-convert-to-ctf fails to dealing with syscalls tracepoints. List-Id: DiaMon diagnostic and monitoring workgroup general discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wang Nan Cc: "diamon-discuss@lists.linuxfoundation.org" , Sebastian Andrzej Siewior On Mon, Jan 19, 2015 at 08:12:04PM +0800, Wang Nan wrote: > Hi Jiri, >=20 > I found a problem when trying to convert syscalls:* records into ctf: >=20 > root@arma15el:~# perf record -a -e syscalls:* sleep 5 >=20 > [ perf record: Woken up 0 times to write data ] > [ perf record: Captured and wrote 4.571 MB perf.data (~199696 samples) ] > Warning: > Processed 64994 events and lost 1 chunks! >=20 > Check IO/CPU overload! >=20 > root@arma15el:~# perf data convert --to-ctf ./out.ctf > Failed to add field 'nr > Failed to add event 'syscalls:sys_enter_io_submit'. > root@arma15el:~# >=20 > Do you have time to have a look at it? >=20 yea, looks like libbabeltrace do not allow field of same name in the structure: --- static int add_structure_field(GPtrArray *fields, GHashTable *field_name_to_index, struct bt_ctf_field_type *field_type, const char *field_name) { int ret =3D 0; GQuark name_quark =3D g_quark_from_string(field_name); struct structure_field *field; /* Make sure structure does not contain a field of the same name */ if (g_hash_table_lookup_extended(field_name_to_index, --- and syscalls:sys_enter_io_submit trcaepoint actually has 'nr' field duplica= tes: --- [root@krava events]# cat /sys/kernel/debug/tracing/events/syscalls/sys_ente= r_io_submit/format=20 name: sys_enter_io_submit ID: 720 format: field:unsigned short common_type; offset:0; size:2; sig= ned:0; field:unsigned char common_flags; offset:2; size:1; sig= ned:0; field:unsigned char common_preempt_count; offset:3; siz= e:1; signed:0; field:int common_pid; offset:4; size:4; signed:1; field:int nr; offset:8; size:4; signed:1; field:aio_context_t ctx_id; offset:16; size:8; signed:0; field:long nr; offset:24; size:8; signed:0; field:struct iocb * * iocbpp; offset:32; size:8; signed:0; print fmt: "ctx_id: 0x%08lx, nr: 0x%08lx, iocbpp: 0x%08lx", ((unsigned long= )(REC->ctx_id)), ((unsigned long)(REC->nr)), ((unsigned long)(REC->iocbpp)) --- which is PITA ;-) seems like reasonable request to keep names unique in the structure, so I think we'll change it on our end (perf data convert) and maybe add some suffix to duplicates like nr_dupl_X.. (where X =3D 1,2..) thoughts? > Moreover, is there (diamon-discuss) right place to discuss things related > your perf-convert-to-ctf patches? lkml is fine (maybe also add linux-perf-users list), but please add also Sebaastian so he's not missing any fun ;-) and J=E9r=E9mie for babeltrace side.. I CC-ed both of them now thanks, jirka