Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp2844923imb; Mon, 4 Mar 2019 16:04:31 -0800 (PST) X-Google-Smtp-Source: APXvYqxoe9/FC+yvqQq3V3D7GaPHwUCCXPqR4/lHkeT2addrUzhizUzp2grnDBSYgkfNxPMvR0pE X-Received: by 2002:a17:902:581:: with SMTP id f1mr23336955plf.210.1551744271160; Mon, 04 Mar 2019 16:04:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551744271; cv=none; d=google.com; s=arc-20160816; b=QsDhMQhp1V/G5m7RIdyJ7Tj8VUsR6btLXEN+8YiJ6DL/vag1TbDmQU7ITF/Sp3QBXr /ZLI5Ch/q16hF2TM+Rp0eSONH7D3ML2aCqhhKFKExj3G52oZu8aZufLON+VsuTjGkX9y gLtQl0DNBe5oJOKISu171PSrWD05TM7IRXHopAX5uMGVk6cKapQ1qJgZAU7MnBHil0Ws 3BXUf5C8qSBMFHug22JkNkfUO4I5JGuB9eJgFyfgLRVXVpyDzDd6sDHGW23KL2foJc3S Knk5XxQNtRgl+wnr4AYrBdPG5aC8GR+8o3A0vd/RL/dXB02DXgodM4wiqD60NaPd9k0T Zl+g== 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:date:cc:to:from:subject:message-id :dkim-signature; bh=cp5Ey1uXB/GdWQQ4cFVi9cOdt2B/xdRl8tl3X84wcJM=; b=ecusZJ+XlRUwNkW+/5tF58f5O944WSwP7CMBB81c7kId060QGJoROj2eXDnzJnBI8R WbpwH3AogrPapngKiGxZIrJSW90jPX9cz28/8wzth8z4gabE7HzeTQ3OoSJUGn1e9pES tfnV4b92h+w4NSH3LhBgz3k3wuw7YEDPLZTow4ydZTlzzw8UzhuEPDpW3taPdQMZafvi JVqfAdrbcQUNZLIbyuEqYcaADX3C1kIEutScEUNdR1MBudpSNn3mKdcW6zxNak3LUFUh PXUKoFu/FQvB7hbER7UYn2AfQD+MMsI5B5LW5hEWCYgsfnytGMgi3camOZmSF6eKGlvD VTzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FQtzdd+m; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x17si6594635plr.435.2019.03.04.16.04.16; Mon, 04 Mar 2019 16:04:31 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=FQtzdd+m; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726842AbfCEACb (ORCPT + 99 others); Mon, 4 Mar 2019 19:02:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:49232 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726716AbfCEAC3 (ORCPT ); Mon, 4 Mar 2019 19:02:29 -0500 Received: from tzanussi-mobl (c-98-220-238-81.hsd1.il.comcast.net [98.220.238.81]) (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 A994E206B8; Tue, 5 Mar 2019 00:02:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551744149; bh=Ux8/YbJjP9yh30Q8QH+q7zD0Qdj3rgun+Bf6UGmdC+U=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=FQtzdd+mnLuMe3A/bTRJFCG+rIo2z0HbPd/PWsHPeICKRjVjtK3xwJkgwhvgagOhu jLxiVxd7ZfmyW5G7GrtggWtZ+90SN3nIXVcudFCjZwt3fz06rntU4VTTo8bfh3BXq4 f11YYUhb6h8piFeX6LM9wxnkAfESNu51W9/VWHtQ= Message-ID: <1551744147.3771.0.camel@kernel.org> Subject: Re: [PATCH 2/2] tracing: Use strncpy instead of memcpy for string keys in hist triggers From: Tom Zanussi To: Steven Rostedt , Tom Zanussi Cc: linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org, Namhyung Kim Date: Mon, 04 Mar 2019 18:02:27 -0600 In-Reply-To: <20190304184530.7e819698@gandalf.local.home> References: <50c35ae1267d64eee975b8125e151e600071d4dc.1549309756.git.tom.zanussi@linux.intel.com> <20190304165000.0ce0fbdd@gandalf.local.home> <20190304165653.17699f9f@gandalf.local.home> <5643a1971831ce2d01a947f0f07cefa002bbdc25.camel@linux.intel.com> <5c978b4b0d629e5a914c512c14f99f6a24241407.camel@linux.intel.com> <20190304184530.7e819698@gandalf.local.home> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.1-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2019-03-04 at 18:45 -0500, Steven Rostedt wrote: > On Mon, 04 Mar 2019 16:31:40 -0600 > Tom Zanussi wrote: > > > > Hmm, I don't think it's really necessary - it's not used in a key > > > so > > > don't care about anything after the null, and TASK_COMM_LEN is > > > used > > > in > > > the memcpy. > > > > Never mind, yeah, it would make sense to do this, will create > > another > > patch... > > And probably should change the memcpy() of comm in > kernel/trace/trace.c > too. It could be that memcpy() is a little bit faster than strncpy(), > and this is done on scheduling switches when tracing is active, but > still, I'm starting to think that isn't a good choice. > OK, will add that too. Tom > -- Steve