From patchwork Mon Mar 5 21:50:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Victor Kamensky \(kamensky\)" X-Patchwork-Id: 130740 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp3180821lja; Mon, 5 Mar 2018 13:50:23 -0800 (PST) X-Google-Smtp-Source: AG47ELv63psvHfbTCwdJs8hvKLtT/uXfozFIqdHalwYvyJ0RF3ONjrWOIFJ/yqq0fzNMxYc8j4ou X-Received: by 2002:a17:902:7294:: with SMTP id d20-v6mr12697517pll.43.1520286622904; Mon, 05 Mar 2018 13:50:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520286622; cv=none; d=google.com; s=arc-20160816; b=MrdliZawOlwuPCOu05OzK0uagyAzF/YSmLqSuf1zelUQvhyELKkeb9/6NvtjNT3ixQ OTJTsOs1BLw3YWb8+nvLUx+6F4K+tlCkB1xj1cgocTnqhcLl1+6edMmvzeEh+o0iJqO7 A/tVtUle9H5dS0/YAYvGjY5c6q4OoGjtYV06veHGnKMzBCv3gZs27hsD7dCIx4vajASu iy13hkuk9KpCAPZpFGqYhk6f3zHtE5n5snK42LxGT2BARroTtR07IsROBxsxBTKa3WEo J1+VrtJ94wCDRuCX5IhWWLEViePpE29G+TsF3sGIFet9QFZmeT8B0aGC9PhBfln0ZFc9 1MWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=IKJlwfW8Lg5seHTAcj2YF0R+Oq98SScmNZYk/CzYTJY=; b=OiHdr9pOh3vjmKL3bBLytwHtYm67so9pJU++Lkg12lLrrRBiYT+h4joe5R/6J0dzYO N7vmCjyMgxzTaIeBi+0agp3/FksB1M/A0FxRFAuqRXpW+U68Bio/HjsypXONd6BiOv2y 3+QceXXClOL6t31N4DCkusByKeQAceypAbHGHQfVxmvQoOfjyHF7+0RaMw7ks29PJTGm QRKuG05Ai/j5WSuIPEAbsu55ZQBvopsLKQ4zOHZ8wwhnCpRuHFkeroZBZSqsAoAh4Mqa d3SUwVZMLYvEjNj/rcLUnQKVvwVFT7Cdpe7o6SbsmLMXnUeV96q2Nu73I/Wgp4xq61A1 bsCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@cisco.com header.s=iport header.b=BxGm1Buf; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cisco.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id n9si8847164pgq.187.2018.03.05.13.50.22; Mon, 05 Mar 2018 13:50:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=fail header.i=@cisco.com header.s=iport header.b=BxGm1Buf; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cisco.com Received: from layers.openembedded.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 35F5D78A86; Mon, 5 Mar 2018 21:50:18 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from rcdn-iport-2.cisco.com (rcdn-iport-2.cisco.com [173.37.86.73]) by mail.openembedded.org (Postfix) with ESMTP id 3936A78A5C for ; Mon, 5 Mar 2018 21:50:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=829; q=dns/txt; s=iport; t=1520286619; x=1521496219; h=from:to:subject:date:message-id; bh=EqyDNBjRIWL/eRIrK84DjkNT3WzebjDvWjDLnZ3k+RQ=; b=BxGm1BufbmHT/nEPO0i5gXudlqS5iasaiJcMTHsFl1Frhb+I0iFwOPjE C09lvlyoX1EdFEdNJ9zAo6pawyaXqA1P5/RiH1rXDXQyT/neQsvHKTAzN CIjD6MQsrCmEHUmPOb/ZAjWf2eBI+isWYnsY9jcsmOi3gInfeIMymaYMb c=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CMAgCVup1a/5pdJa1dGQEBAQEBAQEBAQEBAQcBAQEBAYNQZnAom3GDGJZJChuICiE4FAECAQEBAQEBAmsnh2EBEoUbqzCEcoNxgiuFLYIukXgEjm6LdAmGVIorAoIzjEORKAIRGQGBLjUhgVJNIxWCfQmEYB83jG8BAQE X-IronPort-AV: E=Sophos;i="5.47,428,1515456000"; d="scan'208";a="366871299" Received: from rcdn-core-3.cisco.com ([173.37.93.154]) by rcdn-iport-2.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Mar 2018 21:50:17 +0000 Received: from kamensky-w541.cisco.com ([10.154.177.165]) (authenticated bits=0) by rcdn-core-3.cisco.com (8.14.5/8.14.5) with ESMTP id w25LoB29007375 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NO); Mon, 5 Mar 2018 21:50:17 GMT From: Victor Kamensky To: openembedded-core@lists.openembedded.org, Alexander Kanavin Date: Mon, 5 Mar 2018 13:50:10 -0800 Message-Id: <1520286611-27418-1-git-send-email-kamensky@cisco.com> X-Mailer: git-send-email 2.7.4 X-Authenticated-User: kamensky@cisco.com Subject: [OE-core] [PATCH v2 1/2] systemtap: supports mips starting with version 3.1 X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org Signed-off-by: Victor Kamensky --- meta/recipes-kernel/systemtap/systemtap_git.inc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.7.4 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/recipes-kernel/systemtap/systemtap_git.inc b/meta/recipes-kernel/systemtap/systemtap_git.inc index c938760..d122359 100644 --- a/meta/recipes-kernel/systemtap/systemtap_git.inc +++ b/meta/recipes-kernel/systemtap/systemtap_git.inc @@ -15,8 +15,7 @@ SRC_URI = "git://sourceware.org/git/systemtap.git \ file://0001-staprun-stapbpf-don-t-support-installing-a-non-root.patch \ " -# systemtap doesn't support mips -COMPATIBLE_HOST = '(x86_64|i.86|powerpc|arm|aarch64|microblazeel).*-linux' +COMPATIBLE_HOST = '(x86_64|i.86|powerpc|arm|aarch64|microblazeel|mips).*-linux' S = "${WORKDIR}/git" From patchwork Mon Mar 5 21:50:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Victor Kamensky \(kamensky\)" X-Patchwork-Id: 130741 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp3181005lja; Mon, 5 Mar 2018 13:50:38 -0800 (PST) X-Google-Smtp-Source: AG47ELsKA9XKYNZor8NFJeIpDS/4+prHj0Uiux3RhsjjXakl/m8eRPa3CZEyUjP/si6HzhH6Byay X-Received: by 10.101.64.139 with SMTP id t11mr13132931pgp.304.1520286638726; Mon, 05 Mar 2018 13:50:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520286638; cv=none; d=google.com; s=arc-20160816; b=vQ1ndc8ppDFh6cE64HmuYwGD0xv90bp0Cf5tSg56UUjoMXjRIiQvyXgJN88UDNonyA PUcjOXYiviuoRA2/Nol2xPdMmi27VypdNRm7MJdb5L23zSTJ8VmnqtbxVRLpJ5idxq4D W2YTDy20geMTy0mxpm+Itw90XfyyZmLfIHkQ2TXEP/dhjZnj+pNm+xRUU3+1yrbMaeW8 MJ+E3zQc6KLgMfjkHQxODrv94SuIr8qlRstrmL6TxcXJVtKkEEhSfr/xNjiB8HXNK5E7 NOwybIjRpjHBpSZImjxop0jlhWSzC9hJ2Fv1wjUbu6/uasshJyKFkklwfT1F0CKzkGdi R4cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=ZTWq70eUjyFe7AmYbR9Z1qTWPUEmobML6cuROMNgmjU=; b=oMiTDN2fObuxGt0UrQhKXaMXHwGv/9aXkUrdiWpSI4hh5XG1172W0mnmijfkHmmjxa xUtBiMCHelFkhjMuE4GavSM3qIThvLRmpki4B6bIgnnadLDonE8ppyGktgjR6kekW4bj s0VuXvrEXFfPubDklNU+bSCBLsQ8iV2/YKOxUmdcm+7nvLWwkN/Ue9fT/zYhCyM7l4Sr uecyOPFEc0qKi0AfSoQizFVTIOn5sNAJLJmRtPJ/cqkIV3X1OBEjhWRmuuujGGHu2OoM VzGK8FrYbfMZn9y9eeI2JYRFtSzuFq+jiH4h0/Q76c2JIjM2BmfKGdtGA9GGm2sNLqrq rv4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@cisco.com header.s=iport header.b=m5JlX6bp; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cisco.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id n10si8926659pgc.681.2018.03.05.13.50.38; Mon, 05 Mar 2018 13:50:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=fail header.i=@cisco.com header.s=iport header.b=m5JlX6bp; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cisco.com Received: from layers.openembedded.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 91B5478A89; Mon, 5 Mar 2018 21:50:35 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from rcdn-iport-9.cisco.com (rcdn-iport-9.cisco.com [173.37.86.80]) by mail.openembedded.org (Postfix) with ESMTP id 7539F78A8F for ; Mon, 5 Mar 2018 21:50:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=12274; q=dns/txt; s=iport; t=1520286619; x=1521496219; h=from:to:subject:date:message-id:in-reply-to:references; bh=nyFbNIbn3L023XDt2QkLeA5e2EybLSeeM7Dm4tKFni0=; b=m5JlX6bpNPWM3zjHft4bp/wQjytFYeD30jySOoZrApO+Gjj/CjQqWCH9 G6Su8uQlZUtGTsUQqDZei9Vd2uE4OdKrEjIJzcTaYDKEraxyPBHLqVj+f Eu2A7AjZxGiS6Lnu2WduzeYCrIrkm56ytXn8ecCH0GvYH92FVunLA85jR 8=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0D7AAATup1a/5pdJa1dGQEBAQEBAQEBAQEBAQcBAQEBAYNQZnAojXiNeYICgRaUNBSCAQobgWSDMQKCcyE0GAECAQEBAQEBAmsnhSMBBidiHAMBAi9PCAYBEoUbqnY6iGOCK4Utgi6IMYMfI4YFBI5ui3QJhlSKKwKBZU6MQ4d4iTACERkBgS4eOIFSTSMVgn0JgigMEBaCBh83jG8BAQE X-IronPort-AV: E=Sophos;i="5.47,428,1515456000"; d="scan'208";a="356950835" Received: from rcdn-core-3.cisco.com ([173.37.93.154]) by rcdn-iport-9.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Mar 2018 21:50:18 +0000 Received: from kamensky-w541.cisco.com ([10.154.177.165]) (authenticated bits=0) by rcdn-core-3.cisco.com (8.14.5/8.14.5) with ESMTP id w25LoB2A007375 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NO); Mon, 5 Mar 2018 21:50:17 GMT From: Victor Kamensky To: openembedded-core@lists.openembedded.org, Alexander Kanavin Date: Mon, 5 Mar 2018 13:50:11 -0800 Message-Id: <1520286611-27418-2-git-send-email-kamensky@cisco.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520286611-27418-1-git-send-email-kamensky@cisco.com> References: <1520286611-27418-1-git-send-email-kamensky@cisco.com> X-Authenticated-User: kamensky@cisco.com Subject: [OE-core] [PATCH v2 2/2] systemtap: bring in PR22551 fix that addresses build against 4.15 kernel issue X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org With 4.15 kernel systemtap needs update to address systemtap module compilation issues. It is fixed in later version of systemtap by PR22551. Upstream-Status: Backport Signed-off-by: Victor Kamensky --- ...-by-updating-the-use-of-timers-for-the-4..patch | 277 +++++++++++++++++++++ meta/recipes-kernel/systemtap/systemtap_git.inc | 1 + 2 files changed, 278 insertions(+) create mode 100644 meta/recipes-kernel/systemtap/systemtap/0001-Fix-PR22551-by-updating-the-use-of-timers-for-the-4..patch -- 2.7.4 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/recipes-kernel/systemtap/systemtap/0001-Fix-PR22551-by-updating-the-use-of-timers-for-the-4..patch b/meta/recipes-kernel/systemtap/systemtap/0001-Fix-PR22551-by-updating-the-use-of-timers-for-the-4..patch new file mode 100644 index 0000000..460c3b7 --- /dev/null +++ b/meta/recipes-kernel/systemtap/systemtap/0001-Fix-PR22551-by-updating-the-use-of-timers-for-the-4..patch @@ -0,0 +1,277 @@ +From fbb26e17a4c026f05a497fc5d584516bad3b6950 Mon Sep 17 00:00:00 2001 +From: David Smith +Date: Wed, 6 Dec 2017 14:37:42 -0600 +Subject: [PATCH] Fix PR22551 by updating the use of timers for the 4.15 + kernel. + +* runtime/linux/timer_compatibility.h: New file. +* runtime/time.c: Update timer callback function parameter type. Update + timer initialization. +* runtime/transport/relay_v2.c: Ditto. +* runtime/transport/transport.c: Ditto. +* tapset-timers.cxx (timer_derived_probe_group::emit_module_decls): + Ditto. Handle old and new timer callback interface. +* runtime/linux/runtime.h: Include timer_compatibility.h instead of timer.h. +* tapset/linux/scsi.stp: Ditto. + +Upstream-Status: Backport +Signed-off-by: Victor Kamensky + +--- + runtime/linux/runtime.h | 2 +- + runtime/linux/timer_compatibility.h | 76 +++++++++++++++++++++++++++++++++++++ + runtime/time.c | 7 ++-- + runtime/transport/relay_v2.c | 8 ++-- + runtime/transport/transport.c | 13 +++---- + tapset-timers.cxx | 14 +++++-- + tapset/linux/scsi.stp | 2 +- + 7 files changed, 100 insertions(+), 22 deletions(-) + create mode 100644 runtime/linux/timer_compatibility.h + +diff --git a/runtime/linux/runtime.h b/runtime/linux/runtime.h +index 9c585a2..df9b74c 100644 +--- a/runtime/linux/runtime.h ++++ b/runtime/linux/runtime.h +@@ -34,7 +34,7 @@ + #include + #include + #include +-#include ++#include "timer_compatibility.h" + #include + #include + #include +diff --git a/runtime/linux/timer_compatibility.h b/runtime/linux/timer_compatibility.h +new file mode 100644 +index 0000000..ac03de9 +--- /dev/null ++++ b/runtime/linux/timer_compatibility.h +@@ -0,0 +1,76 @@ ++/* ++ * linux/timer.h compatibility defines and inlines ++ * Copyright (C) 2017 Red Hat Inc. ++ * ++ * This file is part of systemtap, and is free software. You can ++ * redistribute it and/or modify it under the terms of the GNU General ++ * Public License (GPL); either version 2, or (at your option) any ++ * later version. ++ */ ++ ++#ifndef _TIMER_COMPATIBILITY_H_ ++#define _TIMER_COMPATIBILITY_H_ ++ ++#include ++ ++/* ++ * Starting with the 4.15 kernel, the timer interface ++ * changed. Originally, you'd do something like: ++ * ++ * static void timer_func(unsigned long val); ++ * ++ * init_timer(&timer); ++ * timer.expires = jiffies + STP_RELAY_TIMER_INTERVAL; ++ * timer.function = timer_func; ++ * timer.data = 0; ++ * add_timer(&timer); ++ * ++ * The 'data' parameter would get passed to the callback ++ * function. Starting with 4.15, you'd do something like this: ++ * ++ * static void timer_func(struct timer_list *val); ++ * ++ * timer_setup(&timer, timer_func, 0); ++ * timer.expires = jiffies + STP_RELAY_TIMER_INTERVAL; ++ * add_timer(&timer); ++ * ++ * With the new code, the timer that caused the callback gets passed ++ * to the timer callback function. The 'data' field has been removed. ++ * ++ * So, we're going to use the new interface. To hide the differences ++ * between the callback function parameter type, we'll define a new ++ * type, 'stp_timer_callback_parameter_t'. ++ * ++ * If code needs to figure out the difference between the old and new ++ * interface, it should test the TIMER_TRACE_FLAGMASK define (which ++ * only exists in the new interface). ++ */ ++ ++#if defined(TIMER_TRACE_FLAGMASK) ++/* This is the >= 4.15 kernel interface. */ ++ ++typedef struct timer_list * stp_timer_callback_parameter_t; ++ ++#else ++/* This is the < 4.15 kernel interface. */ ++ ++typedef unsigned long stp_timer_callback_parameter_t; ++ ++/** ++ * timer_setup - prepare a timer for first use ++ * @timer: the timer in question ++ * @callback: the function to call when timer expires ++ * @flags: any TIMER_* flags (note that anything other than 0 is an ++ * error, since this compatibility function can't support any ++ * of the TIMER_* flags) ++ */ ++#define timer_setup(timer, callback, flags) \ ++ { \ ++ init_timer((timer)); \ ++ (timer)->function = callback; \ ++ (timer)->data = 0; \ ++ BUILD_BUG_ON_ZERO((flags) != 0); \ ++ } ++#endif ++ ++#endif /* _TIMER_COMPATIBILITY_H_ */ +diff --git a/runtime/time.c b/runtime/time.c +index 2e666d5..91ceafa 100644 +--- a/runtime/time.c ++++ b/runtime/time.c +@@ -168,10 +168,10 @@ __stp_time_smp_callback(void *val) + + /* The timer callback is in a softIRQ -- interrupts enabled. */ + static void +-__stp_time_timer_callback(unsigned long val) ++__stp_time_timer_callback(stp_timer_callback_parameter_t unused) + { + stp_time_t *time =__stp_time_local_update(); +- (void) val; ++ (void) unused; + + /* PR6481: make sure IRQs are enabled before resetting the timer + (IRQs are disabled and then reenabled in +@@ -200,9 +200,8 @@ __stp_init_time(void *info) + time->freq = __stp_get_freq(); + __stp_time_local_update(); + +- init_timer(&time->timer); ++ timer_setup(&time->timer, __stp_time_timer_callback, 0); + time->timer.expires = jiffies + STP_TIME_SYNC_INTERVAL; +- time->timer.function = __stp_time_timer_callback; + + #ifndef STAPCONF_ADD_TIMER_ON + add_timer(&time->timer); +diff --git a/runtime/transport/relay_v2.c b/runtime/transport/relay_v2.c +index f81d75d..135951a 100644 +--- a/runtime/transport/relay_v2.c ++++ b/runtime/transport/relay_v2.c +@@ -30,7 +30,7 @@ + #include + #include + #include +-#include ++#include "../linux/timer_compatibility.h" + #include "../uidgid_compatibility.h" + #include "relay_compat.h" + +@@ -120,7 +120,7 @@ static void __stp_relay_wakeup_readers(struct rchan_buf *buf) + wake_up_interruptible(&buf->read_wait); + } + +-static void __stp_relay_wakeup_timer(unsigned long val) ++static void __stp_relay_wakeup_timer(stp_timer_callback_parameter_t unused) + { + #ifdef STP_BULKMODE + int i; +@@ -151,10 +151,8 @@ static void __stp_relay_wakeup_timer(unsigned long val) + static void __stp_relay_timer_init(void) + { + atomic_set(&_stp_relay_data.wakeup, 0); +- init_timer(&_stp_relay_data.timer); ++ timer_setup(&_stp_relay_data.timer, __stp_relay_wakeup_timer, 0); + _stp_relay_data.timer.expires = jiffies + STP_RELAY_TIMER_INTERVAL; +- _stp_relay_data.timer.function = __stp_relay_wakeup_timer; +- _stp_relay_data.timer.data = 0; + add_timer(&_stp_relay_data.timer); + smp_mb(); + } +diff --git a/runtime/transport/transport.c b/runtime/transport/transport.c +index 3400f22..320fd18 100644 +--- a/runtime/transport/transport.c ++++ b/runtime/transport/transport.c +@@ -311,7 +311,7 @@ static void _stp_detach(void) + } + + +-static void _stp_ctl_work_callback(unsigned long val); ++static void _stp_ctl_work_callback(stp_timer_callback_parameter_t unused); + + /* + * Called when stapio opens the control channel. +@@ -320,13 +320,12 @@ static void _stp_attach(void) + { + dbug_trans(1, "attach\n"); + _stp_pid = current->pid; +- if (_stp_namespaces_pid < 1) +- _stp_namespaces_pid = _stp_pid; ++ if (_stp_namespaces_pid < 1) ++ _stp_namespaces_pid = _stp_pid; + _stp_transport_data_fs_overwrite(0); +- init_timer(&_stp_ctl_work_timer); ++ ++ timer_setup(&_stp_ctl_work_timer, _stp_ctl_work_callback, 0); + _stp_ctl_work_timer.expires = jiffies + STP_CTL_TIMER_INTERVAL; +- _stp_ctl_work_timer.function = _stp_ctl_work_callback; +- _stp_ctl_work_timer.data= 0; + add_timer(&_stp_ctl_work_timer); + } + +@@ -341,7 +340,7 @@ static void _stp_attach(void) + * notified. Reschedules itself if someone is still attached + * to the cmd channel. + */ +-static void _stp_ctl_work_callback(unsigned long val) ++static void _stp_ctl_work_callback(stp_timer_callback_parameter_t unused) + { + int do_io = 0; + unsigned long flags; +diff --git a/tapset-timers.cxx b/tapset-timers.cxx +index 1a40bcd..0ab4d69 100644 +--- a/tapset-timers.cxx ++++ b/tapset-timers.cxx +@@ -122,9 +122,13 @@ timer_derived_probe_group::emit_module_decls (systemtap_session& s) + s.op->newline(-1) << "};"; + s.op->newline(); + +- s.op->newline() << "static void enter_timer_probe (unsigned long val) {"; ++ s.op->newline() << "static void enter_timer_probe (stp_timer_callback_parameter_t val) {"; ++ s.op->newline() << "#if defined(TIMER_TRACE_FLAGMASK)"; ++ s.op->newline(1) << "struct stap_timer_probe* stp = container_of(val, struct stap_timer_probe, timer_list);"; ++ s.op->newline(-1) << "#else"; + s.op->newline(1) << "struct stap_timer_probe* stp = & stap_timer_probes [val];"; +- s.op->newline() << "if ((atomic_read (session_state()) == STAP_SESSION_STARTING) ||"; ++ s.op->newline(-1) << "#endif"; ++ s.op->newline(1) << "if ((atomic_read (session_state()) == STAP_SESSION_STARTING) ||"; + s.op->newline() << " (atomic_read (session_state()) == STAP_SESSION_RUNNING))"; + s.op->newline(1) << "mod_timer (& stp->timer_list, jiffies + "; + emit_interval (s.op); +@@ -148,9 +152,11 @@ timer_derived_probe_group::emit_module_init (systemtap_session& s) + s.op->newline() << "for (i=0; i<" << probes.size() << "; i++) {"; + s.op->newline(1) << "struct stap_timer_probe* stp = & stap_timer_probes [i];"; + s.op->newline() << "probe_point = stp->probe->pp;"; +- s.op->newline() << "init_timer (& stp->timer_list);"; +- s.op->newline() << "stp->timer_list.function = & enter_timer_probe;"; ++ ++ s.op->newline() << "timer_setup (& stp->timer_list, enter_timer_probe, 0);"; ++ s.op->newline() << "#if !defined(TIMER_TRACE_FLAGMASK)"; + s.op->newline() << "stp->timer_list.data = i;"; // NB: important! ++ s.op->newline() << "#endif"; + // copy timer renew calculations from above :-( + s.op->newline() << "stp->timer_list.expires = jiffies + "; + emit_interval (s.op); +diff --git a/tapset/linux/scsi.stp b/tapset/linux/scsi.stp +index 44f686c..3577942 100644 +--- a/tapset/linux/scsi.stp ++++ b/tapset/linux/scsi.stp +@@ -14,7 +14,7 @@ + #include + #include + #include +-#include ++#include "linux/timer_compatibility.h" + #include + %} + +-- +2.7.4 + diff --git a/meta/recipes-kernel/systemtap/systemtap_git.inc b/meta/recipes-kernel/systemtap/systemtap_git.inc index d122359..f51bd28 100644 --- a/meta/recipes-kernel/systemtap/systemtap_git.inc +++ b/meta/recipes-kernel/systemtap/systemtap_git.inc @@ -13,6 +13,7 @@ SRC_URI = "git://sourceware.org/git/systemtap.git \ file://0001-Install-python-modules-to-correct-library-dir.patch \ file://0001-buildrun-remove-quotes-around-I-include-line.patch \ file://0001-staprun-stapbpf-don-t-support-installing-a-non-root.patch \ + file://0001-Fix-PR22551-by-updating-the-use-of-timers-for-the-4..patch \ " COMPATIBLE_HOST = '(x86_64|i.86|powerpc|arm|aarch64|microblazeel|mips).*-linux'