Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934973AbcKNMBi (ORCPT ); Mon, 14 Nov 2016 07:01:38 -0500 Received: from 92-243-34-74.adsl.nanet.at ([92.243.34.74]:50052 "EHLO mail.osadl.at" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1754394AbcKNMBb (ORCPT ); Mon, 14 Nov 2016 07:01:31 -0500 From: Andreas Platschek To: rostedt@goodmis.org Cc: linux-kernel@vger.kernel.org, Andreas Platschek Subject: [PATCH 2/2] trace-cmd: python interface: add global variables to swig interface Date: Mon, 14 Nov 2016 11:55:43 +0000 Message-Id: <1479124543-30911-3-git-send-email-andreas.platschek@opentech.at> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1479124543-30911-1-git-send-email-andreas.platschek@opentech.at> References: <1479124543-30911-1-git-send-email-andreas.platschek@opentech.at> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1126 Lines: 36 Since trace-read.o is now linked into the python library, the global variable silence_warnings and show_status (defined in trace-cmd.c for trace-cmd) used in trace-read.c are also defined in the swig interface. This way the two variables are exposed to python as tracecmd.cvar.silence_warnings and tracecmd.cvar.show_status . If this is not done, running tracecmd.py will fail due to undefined symbols: root@wheezy:/home/andi/working_git/trace-cmd# python tracecmd.py Traceback (most recent call last): File "tracecmd.py", line 22, in from ctracecmd import * ImportError: /home/andi/working_git/trace-cmd/ctracecmd.so: undefined symbol: silence_warnings Signed-off-by: Andreas Platschek --- ctracecmd.i | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ctracecmd.i b/ctracecmd.i index e91d068..7800470 100644 --- a/ctracecmd.i +++ b/ctracecmd.i @@ -35,6 +35,8 @@ static int python_callback(struct trace_seq *s, void *context); static int skip_output = 0; +int silence_warnings; +int show_status; static void py_supress_trace_output(void) { -- 1.7.10.4