Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp776086pxj; Fri, 28 May 2021 15:44:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRiBrs5P5cF6jXcMM+bMCWkkYchRbKxTnYJXm5Ul0yS9wvelr+2ZcQJuXSO9EBLSz//C8B X-Received: by 2002:aa7:d843:: with SMTP id f3mr12461866eds.270.1622241862103; Fri, 28 May 2021 15:44:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622241862; cv=none; d=google.com; s=arc-20160816; b=SaUDNXT5BQxyZJoGJMrUWqHtS9FIX+8hUdLjfxVuL7E4qQJ0gPxgnZs9DJx2ymHOOL zdAOaMyO6DO/7CxHlKkDaN90dL5tXnTzky3prOtgYiYvE8xCK3VPaaBE3AmVnCXPQ1SI pm5EZAvMCN70wjo72oRgvPQeKzZDfc1MnOfJM2qHu7AVCoxozeGwnbI6RaSNqxNtZHmX vDTlHIbS00BKHDwCUdr3CmX47mz+uGxHjLbd99Ug9ALaL1RgdGd1V6oUdpUTHvKx6Spy 5GA7aHtoqAy7a0e5RsDTtozmf0873yRBaTghzwaQLQh9JczVcPMw1kNkCicU4TPVETfn nLaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=frNJ02Rrlg5Nw1rxT2RAS4pchsgPKBTjcMeYmkXv6KI=; b=M+fFxP3Y7AJxPPc8X9gm/UfhAqaLYclcO+mTasuSsd6KBYKgkTwXCFZ7ue6qZzBuPt ZVidVrS9/ptbEmL2odJ6c297pZWZM+Q0SYaZpsReOpLvqMWxDklAsrVYOZFs31ZMxgo8 lKmt0h09b4eTHYSZ6ttIC3EnvX/HbY3T84crGV7+dJFdij9MMy2ghvidcBSlvhwaBAUn kOQAgi/kMcu/1lOc/psculSVDCKMKykgi/e8i5BiKCu2O82Xjg5CZedN9TcoNC4Lw4QH 165GMYyTWcqj6p3bnwsYJ1+8h7MGDZhASJQsoo9O0WcoHWxzClMMyU79paUcyKdGhYZk T3SQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m7si5866761edc.575.2021.05.28.15.43.57; Fri, 28 May 2021 15:44:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229635AbhE1Wo1 (ORCPT + 99 others); Fri, 28 May 2021 18:44:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:52480 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229541AbhE1Wo0 (ORCPT ); Fri, 28 May 2021 18:44:26 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 73D3561378; Fri, 28 May 2021 22:42:50 +0000 (UTC) Date: Fri, 28 May 2021 18:42:48 -0400 From: Steven Rostedt To: Olivier Langlois Cc: Stefan Metzmacher , Pavel Begunkov , Jens Axboe , Ingo Molnar , io-uring@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] io_uring: Add to traces the req pointer when available Message-ID: <20210528184248.46926090@gandalf.local.home> In-Reply-To: <9505850ae4c203f6b8f056265eddbffaae501806.camel@trillion01.com> References: <60ac946e.1c69fb81.5efc2.65deSMTPIN_ADDED_MISSING@mx.google.com> <439a2ab8-765d-9a77-5dfd-dde2bd6884c4@gmail.com> <9a8abcc9-8f7a-8350-cf34-f86e4ac13f5c@samba.org> <9505850ae4c203f6b8f056265eddbffaae501806.camel@trillion01.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 26 May 2021 12:18:37 -0400 Olivier Langlois wrote: > > If that gets changed, could be also include the personality id and > > flags here, > > and maybe also translated the opcode and flags to human readable > > strings? > > > If Jens and Pavel agrees that they would like to see this info in the > traces, I have no objection adding it. > > Still waiting input from Steven Rostedt which I believe is the trace > system maintainer concerning the hash-ptr situation. > > I did receive an auto-respond from him saying that he was in vacation > until May 28th... Yep, I'm back now. Here's how it works using your patch as an example: > TP_fast_assign( > __entry->ctx = ctx; > + __entry->req = req; The "__entry" is a structure defined by TP_STRUCT__entry() that is located on the ring buffer that can be read directly by user space (aka trace-cmd). So yes, that value is never hashed, and one of the reasons that tracefs requires root privilege to read it. > __entry->opcode = opcode; > __entry->user_data = user_data; > __entry->force_nonblock = force_nonblock; > __entry->sq_thread = sq_thread; > ), > > - TP_printk("ring %p, op %d, data 0x%llx, non block %d, sq_thread %d", > - __entry->ctx, __entry->opcode, > - (unsigned long long) __entry->user_data, > - __entry->force_nonblock, __entry->sq_thread) > + TP_printk("ring %p, req %p, op %d, data 0x%llx, non block %d, " > + "sq_thread %d", __entry->ctx, __entry->req, > + __entry->opcode, (unsigned long long)__entry->user_data, > + __entry->force_nonblock, __entry->sq_thread) > ); The TP_printk() macro *is* used when reading the "trace" or "trace_pipe" file, and that uses vsnprintf() to process it. Which will hash the values for %p (by default, because that's what it always did when vsnprintf() started hashing values). Masami Hiramatsu added the hash-ptr option (which I told him to be the default as that was the behavior before that option was created), where the use could turn off the hashing. There's lots of trace events that expose the raw pointers when hash-ptr is off or if the ring buffers are read via the trace_pip_raw interface. What's special about these pointers to hash them before they are recorded? -- Steve