Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp4403690img; Tue, 26 Mar 2019 08:45:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqxbXcY7Me7Ke/+YGwMeJFo3M6BmjclGAr8j5ELzw+u46HqhwGoo+8dXW+IyML4exVpiQDOf X-Received: by 2002:a17:902:8bc3:: with SMTP id r3mr8223021plo.53.1553615126043; Tue, 26 Mar 2019 08:45:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553615126; cv=none; d=google.com; s=arc-20160816; b=nlVphsdQhiGWX5N73nemKK7opU7Rr+p45w9jsuKnoJOJc5Jwq3w22cxVBqmZDG0rDD U+yZTCvAnKC9ftdn7uurzUVTbRwvldqPtHL06mnn9T+Mq1+fVDeZwyHnm/ieZTZ3SYqd fiufho813A3kQqVIpTvyH5vDwdsdH0FV4eWGJSXmETVr4E3YTW0N82k6ep2l7AHRNSCW ZDOca9lfOeiCBaNVfPO0NRZMQQDbplkofbv2+dThMpi9J8VW3jQlDG2xDrpfYVAiU4Ot V4wfhIavfXedvZ7p6AEAspkGf3JSGbUqWpSnEq8+ij1ykUOJute4QfFKo9won2rRS6B8 OJkw== 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:date:subject:cc:to:from; bh=lW5yG1sGsyFAaf+D4sbXrnx/PaBrBMbCRvcHmfxct2A=; b=brpTpb5MBjkq1USHI7olXLnajOUTBTKCZ3x8rpcmK6IuWZFiqbOTGCDivKcc4ow0G2 RJar02037qQYg6cMRuQN/O8gAT4vRkSknsTPzRKHYJFfNawiU93MrR4eMHmH43YsOmMX JjPUxm0HcmHPqi2oHSkcOiAZABDbl/VmLSWujT24rR60/6Ns/HcsyTvY7wlszNG089hr vMEpIUH/CX/dA/ByU1o8l0Et/MviebdxPqaF8wM6XTYW2C4gGzOnvbZmJ9NZ76QK8gqm rpx1M9SHOCRmb9Tt186oAE4kVM46PQ4ePFLz7N7zdCHqaWrPfZDhhulMBmHX3Wn4cZsD b9Gw== 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vmware.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m19si3312995pgk.76.2019.03.26.08.45.10; Tue, 26 Mar 2019 08:45:26 -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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vmware.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731570AbfCZPoF (ORCPT + 99 others); Tue, 26 Mar 2019 11:44:05 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:36542 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732089AbfCZPnk (ORCPT ); Tue, 26 Mar 2019 11:43:40 -0400 Received: by mail-wr1-f67.google.com with SMTP id y13so14969901wrd.3; Tue, 26 Mar 2019 08:43:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lW5yG1sGsyFAaf+D4sbXrnx/PaBrBMbCRvcHmfxct2A=; b=TdeI3xdtJEFxtg+DpTtiTzt8FNHcR+ViFXDnHRh5Q8ErzB59IdJLVycZ0AOHWU/mAI C9ZqFlNBAJasPPifsS1aIenP5GuiRkdmsqS+LJwsyY1yKwSEyY+2jgAynh6A9eDboi73 KskNF7NcGcoBqrD+IRSpEN6sXgGRa2o2LSdS6NybTIXy2ksMT6GG+CWcrNrATQA05ywU BQQG/z4UjXW9Z4KJeYqNGSr7y1RyXCJU1pcRdw9ve3+/rL1LeGh7mgDYmVbrfh62IhQR x+5MSw2DNIoBmiZtCYHJuhIFtGHxkNWy1W9QHWk4+ttAEUq0Kq4qNAVuLwTznqiBCdC+ HFLA== X-Gm-Message-State: APjAAAXJmMJCEwSBdUxYE1raZvuE5eAHaV4TBnd0PH2k+w63vXnEwnc7 IOhqbVzhhJFRdoQvLCl7DMA= X-Received: by 2002:adf:cd90:: with SMTP id q16mr19459932wrj.75.1553615018906; Tue, 26 Mar 2019 08:43:38 -0700 (PDT) Received: from oberon.eng.vmware.com ([146.247.46.5]) by smtp.gmail.com with ESMTPSA id n11sm31927685wrt.63.2019.03.26.08.43.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Mar 2019 08:43:38 -0700 (PDT) From: Tzvetomir Stoyanov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 8/8] tools/lib/traceevent: remove call to exit() from tep_filter_add_filter_str() Date: Tue, 26 Mar 2019 17:43:28 +0200 Message-Id: <20190326154328.28718-9-tstoyanov@vmware.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190326154328.28718-1-tstoyanov@vmware.com> References: <20190326154328.28718-1-tstoyanov@vmware.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch removes call to exit() from tep_filter_add_filter_str(). A library function should not force the application to exit. In the current implementation tep_filter_add_filter_str() calls exit() when a special "test_filters" mode is set, used only for debugging purposes. When this mode is set and a filter is added - its string is printed to the console and exit() is called. This patch changes the logic - when in "test_filters" mode, the filter string is still printed, but the exit() is not called. It is up to the application to track when "test_filters" mode is set and to call exit, if needed. Signed-off-by: Tzvetomir Stoyanov --- tools/lib/traceevent/parse-filter.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c index 298694356277..552592d153fb 100644 --- a/tools/lib/traceevent/parse-filter.c +++ b/tools/lib/traceevent/parse-filter.c @@ -1346,9 +1346,6 @@ enum tep_errno tep_filter_add_filter_str(struct tep_event_filter *filter, free_events(events); - if (rtn >= 0 && tep->test_filters) - exit(0); - return rtn; } -- 2.20.1