From b080939be74ae5270c78e011bd8d74968fe57a2a Mon Sep 17 00:00:00 2001
From: Josh Boyer <jwboyer@redhat.com>
Date: Mon, 6 Feb 2012 12:44:21 -0500
Subject: [PATCH] Linux 3.3-rc2-git4 (upstream
 23783f817bceedd6d4e549385e3f400ea64059e5)

Build and ship turbostat and x86_energy_perf_policy in kernel tools
---
 kernel.spec             |  40 +++++++++++++---
 kmemleak.patch          | 100 ----------------------------------------
 power-x86-destdir.patch |  34 ++++++++++++++
 sources                 |   2 +-
 4 files changed, 68 insertions(+), 108 deletions(-)
 delete mode 100644 kmemleak.patch
 create mode 100644 power-x86-destdir.patch

diff --git a/kernel.spec b/kernel.spec
index 670f20dc8..6dd289c40 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -54,7 +54,7 @@ Summary: The Linux kernel
 # For non-released -rc kernels, this will be appended after the rcX and
 # gitX tags, so a 3 here would become part of release "0.rcX.gitX.3"
 #
-%global baserelease 2
+%global baserelease 1
 %global fedora_build %{baserelease}
 
 # base_sublevel is the kernel version we're starting with and patching
@@ -87,7 +87,7 @@ Summary: The Linux kernel
 # The rc snapshot level
 %define rcrev 2
 # The git snapshot level
-%define gitrev 3
+%define gitrev 4
 # Set rpm version accordingly
 %define rpmversion 3.%{upstream_sublevel}.0
 %endif
@@ -737,12 +737,12 @@ Patch21070: ext4-Support-check-none-nocheck-mount-options.patch
 Patch21073: KVM-x86-extend-struct-x86_emulate_ops-with-get_cpuid.patch
 Patch21074: KVM-x86-fix-missing-checks-in-syscall-emulation.patch
 
-Patch21091: kmemleak.patch
-
 Patch21092: udlfb-remove-sysfs-framebuffer-device-with-USB-disconnect.patch
 
 Patch21093: rt2x00_fix_MCU_request_failures.patch
 
+Patch21094: power-x86-destdir.patch
+
 # compat-wireless patches
 Patch50000: compat-wireless-config-fixups.patch
 Patch50001: compat-wireless-pr_fmt-warning-avoidance.patch
@@ -1427,13 +1427,13 @@ ApplyPatch ext4-Support-check-none-nocheck-mount-options.patch
 ApplyPatch KVM-x86-extend-struct-x86_emulate_ops-with-get_cpuid.patch
 ApplyPatch KVM-x86-fix-missing-checks-in-syscall-emulation.patch
 
-ApplyPatch kmemleak.patch
-
 ApplyPatch udlfb-remove-sysfs-framebuffer-device-with-USB-disconnect.patch
 
 #rhbz 772772
 ApplyPatch rt2x00_fix_MCU_request_failures.patch
 
+ApplyPatch power-x86-destdir.patch
+
 # END OF PATCH APPLICATIONS
 
 %endif
@@ -1885,6 +1885,14 @@ make %{?_smp_mflags} -C tools/power/cpupower CPUFREQ_BENCH=false
     make %{?_smp_mflags} centrino-decode powernow-k8-decode
     cd -
 %endif
+%ifarch %{ix86} x86_64
+   cd tools/power/x86/x86_energy_perf_policy/
+   make
+   cd -
+   cd tools/power/x86/turbostat
+   make
+   cd -
+%endif #turbostat/x86_energy_perf_policy
 %endif
 %endif
 
@@ -2001,7 +2009,15 @@ mkdir -p %{buildroot}%{_unitdir} %{buildroot}%{_sysconfdir}/sysconfig
 install -m644 %{SOURCE2000} %{buildroot}%{_unitdir}/cpupower.service
 install -m644 %{SOURCE2001} %{buildroot}%{_sysconfdir}/sysconfig/cpupower
 %endif
-
+%ifarch %{ix86} x86_64
+   mkdir -p %{buildroot}%{_mandir}/man8
+   cd tools/power/x86/x86_energy_perf_policy
+   make DESTDIR=%{buildroot} install
+   cd -
+   cd tools/power/x86/turbostat
+   make DESTDIR=%{buildroot} install
+   cd -
+%endif #turbostat/x86_energy_perf_policy
 %endif
 
 %if %{with_bootwrapper}
@@ -2192,6 +2208,12 @@ fi
 %{_unitdir}/cpupower.service
 %{_mandir}/man[1-8]/cpupower*
 %config(noreplace) %{_sysconfdir}/sysconfig/cpupower
+%ifarch %{ix86} x86_64
+%{_bindir}/x86_energy_perf_policy
+%{_mandir}/man8/x86_energy_perf_policy*
+%{_bindir}/turbostat
+%{_mandir}/man8/turbostat*
+%endif
 %endif
 
 %if %{with_debuginfo}
@@ -2277,6 +2299,10 @@ fi
 #                 ||----w |
 #                 ||     ||
 %changelog
+* Mon Feb 06 2012 Josh Boyer <jwboyer@redhat.com> - 3.3.0-0.rc2.git4.1
+- Linux 3.3-rc2-git4 (upstream 23783f817bceedd6d4e549385e3f400ea64059e5)
+- Build and ship turbostat and x86_energy_perf_policy in kernel-tools
+
 * Mon Feb 06 2012 John W. Linville <linville@redhat.com>
 - Update compat-wireless snapshot from 2012-02-05
 
diff --git a/kmemleak.patch b/kmemleak.patch
deleted file mode 100644
index 56bd860db..000000000
--- a/kmemleak.patch
+++ /dev/null
@@ -1,100 +0,0 @@
-                                                                                                                                                                                                                                                               
-Delivered-To: jwboyer@gmail.com
-Received: by 10.216.166.66 with SMTP id f44cs7120wel;
-        Fri, 20 Jan 2012 03:02:14 -0800 (PST)
-Received: by 10.68.72.8 with SMTP id z8mr60494730pbu.111.1327057318390;
-        Fri, 20 Jan 2012 03:01:58 -0800 (PST)
-Return-Path: <linux-kernel-owner@vger.kernel.org>
-Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67])
-        by mx.google.com with ESMTP id q8si4181579pbn.101.2012.01.20.03.01.56;
-        Fri, 20 Jan 2012 03:01:58 -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; 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.mail=linux-kernel-owner@vger.kernel.org
-Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
-	id S1751460Ab2ATLBU (ORCPT <rfc822;ramashish.lists@gmail.com>
-	+ 99 others); Fri, 20 Jan 2012 06:01:20 -0500
-Received: from cam-admin0.cambridge.arm.com ([217.140.96.50]:34737 "EHLO
-	cam-admin0.cambridge.arm.com" rhost-flags-OK-OK-OK-OK)
-	by vger.kernel.org with ESMTP id S1750877Ab2ATLBT (ORCPT
-	<rfc822;linux-kernel@vger.kernel.org>);
-	Fri, 20 Jan 2012 06:01:19 -0500
-Received: from arm.com (e102109-lin.cambridge.arm.com [10.1.69.68])
-	by cam-admin0.cambridge.arm.com (8.12.6/8.12.6) with ESMTP id q0KB1CWq000059;
-	Fri, 20 Jan 2012 11:01:12 GMT
-Date:	Fri, 20 Jan 2012 11:01:11 +0000
-From:	Catalin Marinas <catalin.marinas@arm.com>
-To:	Dirk Gouders <gouders@et.bocholt.fh-gelsenkirchen.de>
-Cc:	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
-Subject: Re: [Problem] kernel hangs at boot (bisected 892d208bcf)
-Message-ID: <20120120110111.GB30612@arm.com>
-References: <gi39bcyff8.fsf@mx10.gouders.net>
- <20120119110121.GC9268@arm.com>
- <gi1uqvsx8n.fsf@karga.hank.lab>
- <20120119140058.GA19036@arm.com>
- <gik44nrc52.fsf@karga.hank.lab>
- <20120119153732.GB20558@arm.com>
- <gi1uqvwpt2.fsf@mx10.gouders.net>
- <gimx9jv50u.fsf@mx10.gouders.net>
- <giipk7v2hv.fsf@mx10.gouders.net>
-MIME-Version: 1.0
-Content-Type: text/plain; charset=us-ascii
-Content-Disposition: inline
-In-Reply-To: <giipk7v2hv.fsf@mx10.gouders.net>
-Thread-Topic: [Problem] kernel hangs at boot (bisected 892d208bcf)
-Accept-Language: en-GB, en-US
-Content-Language: en-US
-User-Agent: Mutt/1.5.20 (2009-06-14)
-Sender:	linux-kernel-owner@vger.kernel.org
-Precedence: bulk
-List-ID: <linux-kernel.vger.kernel.org>
-X-Mailing-List:	linux-kernel@vger.kernel.org
-
-On Thu, Jan 19, 2012 at 08:52:44PM +0000, Dirk Gouders wrote:
-> Dirk Gouders <gouders@et.bocholt.fh-gelsenkirchen.de> writes:
-> I want to note that in my config CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF is
-> set which causes kmemleak_disable() to be called in kmemleak_init().
-
-Thanks for the investigation. Could you please try the patch below?
-Thanks.
-
-
-From 09e7bd41ff3fd07e4c5eea7bbb0a045921eb5944 Mon Sep 17 00:00:00 2001
-From: Catalin Marinas <catalin.marinas@arm.com>
-Date: Fri, 20 Jan 2012 10:42:40 +0000
-Subject: [PATCH] kmemleak: Disable early logging when kmemleak is off by
- default
-
-Commit b6693005 (kmemleak: When the early log buffer is exceeded, report
-the actual number) deferred the disabling of the early logging to
-kmemleak_init(). However, when CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF=y, the
-early logging was no longer disabled causing __init kmemleak functions
-to be called even after the kernel freed the init memory. This patch
-disables the early logging during kmemleak_init() if kmemleak is left
-disabled.
-
-Reported-by: Dirk Gouders <gouders@et.bocholt.fh-gelsenkirchen.de>
-Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
----
- mm/kmemleak.c |    1 +
- 1 files changed, 1 insertions(+), 0 deletions(-)
-
-diff --git a/mm/kmemleak.c b/mm/kmemleak.c
-index f9f7310..45eb621 100644
---- a/mm/kmemleak.c
-+++ b/mm/kmemleak.c
-@@ -1757,6 +1757,7 @@ void __init kmemleak_init(void)
- 
- #ifdef CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF
- 	if (!kmemleak_skip_disable) {
-+		atomic_set(&kmemleak_early_log, 0);
- 		kmemleak_disable();
- 		return;
- 	}
-
--- 
-Catalin
---
-To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
-the body of a message to majordomo@vger.kernel.org
-More majordomo info at  http://vger.kernel.org/majordomo-info.html
-Please read the FAQ at  http://www.tux.org/lkml/
diff --git a/power-x86-destdir.patch b/power-x86-destdir.patch
new file mode 100644
index 000000000..5fb48ac13
--- /dev/null
+++ b/power-x86-destdir.patch
@@ -0,0 +1,34 @@
+diff --git a/tools/power/x86/turbostat/Makefile b/tools/power/x86/turbostat/Makefile
+index fd8e1f1..7af5e8c 100644
+--- a/tools/power/x86/turbostat/Makefile
++++ b/tools/power/x86/turbostat/Makefile
+@@ -1,8 +1,10 @@
++DESTDIR ?=
++
+ turbostat : turbostat.c
+ 
+ clean :
+ 	rm -f turbostat
+ 
+ install :
+-	install turbostat /usr/bin/turbostat
+-	install turbostat.8 /usr/share/man/man8
++	install turbostat ${DESTDIR}/usr/bin/turbostat
++	install turbostat.8 ${DESTDIR}/usr/share/man/man8
+diff --git a/tools/power/x86/x86_energy_perf_policy/Makefile b/tools/power/x86/x86_energy_perf_policy/Makefile
+index f458237..f9824f0 100644
+--- a/tools/power/x86/x86_energy_perf_policy/Makefile
++++ b/tools/power/x86/x86_energy_perf_policy/Makefile
+@@ -1,8 +1,10 @@
++DESTDIR ?= 
++
+ x86_energy_perf_policy : x86_energy_perf_policy.c
+ 
+ clean :
+ 	rm -f x86_energy_perf_policy
+ 
+ install :
+-	install x86_energy_perf_policy /usr/bin/
+-	install x86_energy_perf_policy.8 /usr/share/man/man8/
++	install x86_energy_perf_policy ${DESTDIR}/usr/bin/
++	install x86_energy_perf_policy.8 ${DESTDIR}/usr/share/man/man8/
diff --git a/sources b/sources
index 7318a0668..7dc0dab02 100644
--- a/sources
+++ b/sources
@@ -1,4 +1,4 @@
 364066fa18767ec0ae5f4e4abcf9dc51  linux-3.2.tar.xz
 465f9cf994d5c94b15ba167fae8e60fb  patch-3.3-rc2.xz
-5a36e83118c2eb6ed433cab0f131ff0b  patch-3.3-rc2-git3.xz
 02c210a8fd24acca8c1ac93f6f1d3913  compat-wireless-2012-02-05.tar.bz2
+6fb8657a48ee783f62211ead8c5b9977  patch-3.3-rc2-git4.xz