Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3291244lfo; Mon, 23 May 2022 00:52:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDfSd7BL6yhmOjk6syljl8GH6hLvaY7p57p6rmieOsv9gL1F5HxxqQKkZD80eyl6xUiYzB X-Received: by 2002:a05:6a00:1a90:b0:518:8459:528a with SMTP id e16-20020a056a001a9000b005188459528amr9625767pfv.83.1653292325373; Mon, 23 May 2022 00:52:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653292325; cv=none; d=google.com; s=arc-20160816; b=haYnVJ5OwaY2QLnLJkKmDQ6CA+1+IyO7X8oR42ZyERp/WVKXoxCqH/r1h6OdXRhnW0 Y/Ca8xsF4SAdPYcPAmP7DgAmZfNUjDOoH8OZDF6CF5qOIUKIyUuAvOmQeHuAd2a/1yr6 dwCFJICR6a97pyxvsw8HTdE0K0GA1Qg8X1VsJku1aYF5g6FGCelY+XpI2j17GpSrUyVz RvLNfiVBjUciyBXRR8h02KdaGKB0pBFck/5RrPcY+50sAiroAO1/WkG9jc6vAxW4Pdvp ZJjf8bbidJdZfbMNzot4NuFfeI06Dhj2dUk/AuJQnXFvnkajIL2LZxWVm7eLcDyaVpHU LkeA== 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 :dkim-signature; bh=vlGHuqMkQXPx19fGqT0Ho2fDioVVQGTaNWo9WB/A0H4=; b=PT+2XZ8ZYsNqvOGSBsPISx276vlCKk7KojXFryh/hkcThERcbgUjzdyagYV2NCoUKH x+JRhwFC9QMVNGLeQybwCLTxRQTy/mL7bfm/viftZ042tkfXWEdMAM9fPseOI3Kln9RT fl5wiQ6qOd8PhgrWwxwzy90uLKWAPvsx7tTRmx7e3V6gleLJTdWTZ78iSRJ4w+Pmk+4f +2uw2Tg/QD1ANZ8tcXQjeP3H8vky9Mvc5fPFmcN/f/Q746S5L9WUB49XQ5qHt0U8K1JZ 9KcDbKbi/A9eU2EOVQw2aUXAm42Vk/yicMAElCTqQfOg2PM7z7d+pBgLUumFvsjA0tX2 wEYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=r8DCVZq+; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id y71-20020a638a4a000000b003fa1e2e80a9si6139181pgd.659.2022.05.23.00.52.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 00:52:05 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=r8DCVZq+; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BEB7E44764; Sun, 22 May 2022 23:57:21 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346787AbiEVOW3 (ORCPT + 99 others); Sun, 22 May 2022 10:22:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239031AbiEVOWZ (ORCPT ); Sun, 22 May 2022 10:22:25 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD09A3968C for ; Sun, 22 May 2022 07:22:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 80462B80AE9 for ; Sun, 22 May 2022 14:22:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3BE5DC385AA; Sun, 22 May 2022 14:22:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653229341; bh=5jwl99JxBIUjh3Qh5dWJ3BCJiWyb5trvHhe0CaZLHdo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=r8DCVZq+h53FFG2HiBhtx6fqFfPoWp9FQpIEVSnY1xL1bCwYER3Gg3PI3DsnioD3T debkWl9utxa5WSxuyCgoLVAVEop78dj95Cgn23Dg60wKypGmWxFLTPqZoawfLnAa4o 5knxwUZVEKv4BG5uqbFN23+se71IsgnPfQRwDGbwapWWFJyR+dshfvKhFChAWqL5IT 17lHuQ0RD8TceaqJz2a6Qlz+hZBtqZ5Ns27AWr8webq75EIaYpiNXBA5f56MBQWIYz 6CexGKbnp8TzkhbHJqSzUF2SD7eDZQrAE3GicNZyUHnWEWV7Ij2MU2NPBV0Zkgdlk1 sGefprsLXYr3Q== Date: Sun, 22 May 2022 23:22:16 +0900 From: Masami Hiramatsu (Google) To: Jeff Xie Cc: rostedt@goodmis.org, mingo@redhat.com, mhiramat@kernel.org, zanussi@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v10 2/4] trace/objtrace: Get the value of the object Message-Id: <20220522232216.bb1451fb6efc18c2bccc8d09@kernel.org> In-Reply-To: <20220512170008.1301613-3-xiehuan09@gmail.com> References: <20220512170008.1301613-1-xiehuan09@gmail.com> <20220512170008.1301613-3-xiehuan09@gmail.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jeff, On Fri, 13 May 2022 01:00:06 +0800 Jeff Xie wrote: [...] > @@ -175,9 +271,27 @@ trace_object_trigger(struct event_trigger_data *data, > > field = obj_data->field; > memcpy(&obj, rec + field->offset, sizeof(obj)); > - set_trace_object(obj, tr); > + /* set the offset from the special object and the type size of the value*/ > + set_trace_object(obj, obj_data->obj_offset, > + obj_data->obj_value_type_size, tr); > } > > +static const struct objtrace_fetch_type objtrace_fetch_types[] = { > + {"u8", 1}, > + {"s8", 1}, > + {"x8", 1}, > + {"u16", 2}, > + {"s16", 2}, > + {"x16", 2}, > + {"u32", 4}, > + {"s32", 4}, > + {"x32", 4}, > + {"u64", 8}, > + {"s64", 8}, > + {"x64", 8}, Hmm, as far as I can see, you don't distinguish the prefix 'u','s','x'. If so, please support only 'x' at this moment. kprobe events supports those types, and it distinguishes the types when printing the logged data. E.g. 's16' shows '-1' for 0xffff, but 'x16' shows '0xffff'. You can add another patch to support such different types afterwards. > + {} If this array is null terminated, please explictly do that, like {NULL, 0}, for readability. Thank you, -- Masami Hiramatsu (Google)