Received: by 10.213.65.68 with SMTP id h4csp2736785imn; Mon, 2 Apr 2018 13:04:14 -0700 (PDT) X-Google-Smtp-Source: AIpwx495Jskc8npo7PMfT80wXZal5pSbrn64lOBEx01F9gzvJXE1g/OaLrni0mfhbx3MDVX1/V1F X-Received: by 10.167.131.203 with SMTP id j11mr8375610pfn.101.1522699454161; Mon, 02 Apr 2018 13:04:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522699454; cv=none; d=google.com; s=arc-20160816; b=Z3rZUKMvPz1FIRSDIkgDuf5UzMYiiQ/2UjCJOYLd1B/WpRuYzkMlZ+KdUMQwBSB5HO RLoC3LePwlr1Pvy1KhS6kqf51tpEBWHOqPErd0Du+BpBL/Xhdsceu8rCbED5kixJO3xH MnVxrn8Bx4E3FzkUHRZ6m/VHasLiPcUgDvGvGKkyIhzbpbdG4wYrz1SDmszVat9G9JMW CjxKpvKbgPpBUDW/adPWWKVOgVGRwX6iZ1NNjb5GC0vLlv/NcXYguAIPgPv9i4QUcxgb IA6MDMDSWuQPXUC16++ZiOFr4jIyR61NgXFtnZdbx8BGE5x4VXKKi2lFLU7Frea/mbPm VSLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dmarc-filter:arc-authentication-results; bh=8cu4sXEAU2+/H/PQtIzuMUS/EVqKEzmJKkHwSc0EGrU=; b=fX7rl+wme7yyf6xS/jAiXA2Oc4fWNS4xzZVQsK34L0qwkNv4JypaC+Enp6n954RNTE JZp63JruWY9EczllAaVCGjera0WJ2bohvyV6JIVrRmnQQMnrCb7ptZ6YKShFXy/4R19j 4IRM7DM7gEH1PqT4CoCSzPH/dDoSsbnfe8mXF00O6MpLiKmE27USEZYrXXNkHxpJmeTs NfKLBOHUWaO8dlEnWndoTjv0rfpY4lVgn/dxUSqKYs+yafeeIYoh9BNqc+w6mCiZ8RBV fVDnTsLb1TGVnTMtRjQ9GYXAQKdwry6ZL0laNQat9z/Wi3IA5A2CB4nazhikum3KUDRp VN3Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e4si714170pga.1.2018.04.02.13.04.00; Mon, 02 Apr 2018 13:04:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932448AbeDBUCM (ORCPT + 99 others); Mon, 2 Apr 2018 16:02:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:46870 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932412AbeDBUCL (ORCPT ); Mon, 2 Apr 2018 16:02:11 -0400 Received: from gandalf.local.home (cpe-66-24-56-78.stny.res.rr.com [66.24.56.78]) (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 501E9214EE; Mon, 2 Apr 2018 20:02:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 501E9214EE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Date: Mon, 2 Apr 2018 16:02:07 -0400 From: Steven Rostedt To: Masami Hiramatsu Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Namhyung Kim , Tom Zanussi , Arnaldo Carvalho de Melo , linux-trace-users@vger.kernel.org, linux-kselftest@vger.kernel.org, shuah@kernel.org, Ravi Bangoria Subject: Re: [PATCH v6 10/21] tracing: probeevent: Return consumed bytes of dynamic area Message-ID: <20180402160207.23c96309@gandalf.local.home> In-Reply-To: <152129069244.31874.7879658400858676349.stgit@devbox> References: <152129024033.31874.15800253385376959274.stgit@devbox> <152129069244.31874.7879658400858676349.stgit@devbox> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 17 Mar 2018 21:44:52 +0900 Masami Hiramatsu wrote: > -static nokprobe_inline void > -fetch_store_string(unsigned long addr, void *dest) > +static nokprobe_inline int > +fetch_store_string(unsigned long addr, void *dest, void *base) > { > - int maxlen = get_rloc_len(*(u32 *)dest); > - u8 *dst = get_rloc_data(dest); > + int maxlen = get_loc_len(*(u32 *)dest); > + u8 *dst = get_loc_data(dest, base); > long ret; > > if (!maxlen) > - return; > + return -ENOMEM; > > /* > * Try to get string again, since the string can be changed while > @@ -854,19 +851,19 @@ fetch_store_string(unsigned long addr, void *dest) > > if (ret < 0) { /* Failed to fetch string */ > dst[0] = '\0'; > - *(u32 *)dest = make_data_rloc(0, get_rloc_offs(*(u32 *)dest)); > - } else { > - *(u32 *)dest = make_data_rloc(ret, get_rloc_offs(*(u32 *)dest)); > + ret = 0; Why do you return 0 here and not the error value? You return -ENOMEM above if maxlen is zero. -- Steve > } > + *(u32 *)dest = make_data_loc(ret, (void *)dst - base); > + return ret; > }