* [PATCH 1/3] ACPICA: acpidump: Cleanup tools/power/acpi makefiles.
2014-01-15 4:03 ` [PATCH 0/3] ACPI: Integrate tools/power/acpi Makefile into tools Makefile Lv Zheng
@ 2014-01-15 4:04 ` Lv Zheng
2014-01-15 4:04 ` [PATCH 2/3] ACPICA: acpidump: Enable tools Makefile to include acpi tools Lv Zheng
` (3 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Lv Zheng @ 2014-01-15 4:04 UTC (permalink / raw)
To: Rafael J. Wysocki, Len Brown; +Cc: Lv Zheng, Lv Zheng, linux-acpi
This patch cleans up old tools/power/acpi Makefile for further porting,
make it compiled in a similar way as the other tools. No functional
changes.
The CFLAGS is modified as follows:
1. Previous cc flags:
-Wall -Wstrict-prototypes -Wdeclaration-after-statement -Os -s \
-D_LINUX -DDEFINE_ALTERNATE_TYPES -I../../../include
2. Current cc flags:
DEBUG=false:
-D_LINUX -DDEFINE_ALTERNATE_TYPES -I../../../include -Wall \
-Wstrict-prototypes -Wdeclaration-after-statement -Os \
-fomit-frame-pointer
Normal:
-D_LINUX -DDEFINE_ALTERNATE_TYPES -I../../../include -Wall \
-Wstrict-prototypes -Wdeclaration-after-statement -O1 -g -DDEBUG
There is only one difference: -fomit-frame-pointer.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
tools/power/acpi/Makefile | 149 ++++++++++++++++++++--
tools/power/acpi/{ => man}/acpidump.8 | 0
tools/power/acpi/{ => tools/acpidump}/acpidump.c | 0
3 files changed, 137 insertions(+), 12 deletions(-)
rename tools/power/acpi/{ => man}/acpidump.8 (100%)
rename tools/power/acpi/{ => tools/acpidump}/acpidump.c (100%)
diff --git a/tools/power/acpi/Makefile b/tools/power/acpi/Makefile
index bafeb8d..d9186a2 100644
--- a/tools/power/acpi/Makefile
+++ b/tools/power/acpi/Makefile
@@ -1,18 +1,143 @@
-PROG= acpidump
-SRCS= acpidump.c
+# tools/power/acpi/Makefile - ACPI tool Makefile
+#
+# Copyright (c) 2013, Intel Corporation
+# Author: Lv Zheng <lv.zheng@intel.com>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; version 2
+# of the License.
+
+OUTPUT=./
+ifeq ("$(origin O)", "command line")
+ OUTPUT := $(O)/
+endif
+
+ifneq ($(OUTPUT),)
+# check that the output directory actually exists
+OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd)
+$(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist))
+endif
+
+# --- CONFIGURATION BEGIN ---
+
+# Set the following to `true' to make a unstripped, unoptimized
+# binary. Leave this set to `false' for production use.
+DEBUG ?= true
+
+# make the build silent. Set this to something else to make it noisy again.
+V ?= false
+
+# Prefix to the directories we're installing to
+DESTDIR ?=
+
+# --- CONFIGURATION END ---
+
+# Directory definitions. These are default and most probably
+# do not need to be changed. Please note that DESTDIR is
+# added in front of any of them
+
+bindir ?= /usr/bin
+sbindir ?= /usr/sbin
+mandir ?= /usr/man
+
+# Toolchain: what tools do we use, and what options do they need:
+
+INSTALL = /usr/bin/install -c
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_SCRIPT = ${INSTALL_PROGRAM}
+
+# If you are running a cross compiler, you may want to set this
+# to something more interesting, like "arm-linux-". If you want
+# to compile vs uClibc, that can be done here as well.
+CROSS = #/usr/i386-linux-uclibc/usr/bin/i386-uclibc-
+CC = $(CROSS)gcc
+LD = $(CROSS)gcc
+STRIP = $(CROSS)strip
+HOSTCC = gcc
+
+# check if compiler option is supported
+cc-supports = ${shell if $(CC) ${1} -S -o /dev/null -x c /dev/null > /dev/null 2>&1; then echo "$(1)"; fi;}
+
+# use '-Os' optimization if available, else use -O2
+OPTIMIZATION := $(call cc-supports,-Os,-O2)
+
+WARNINGS := -Wall
+WARNINGS += $(call cc-supports,-Wstrict-prototypes)
+WARNINGS += $(call cc-supports,-Wdeclaration-after-statement)
+
KERNEL_INCLUDE := ../../../include
-CFLAGS += -Wall -Wstrict-prototypes -Wdeclaration-after-statement -Os -s -D_LINUX -DDEFINE_ALTERNATE_TYPES -I$(KERNEL_INCLUDE)
+CFLAGS += -D_LINUX -DDEFINE_ALTERNATE_TYPES -I$(KERNEL_INCLUDE)
+CFLAGS += $(WARNINGS)
+
+ifeq ($(strip $(V)),false)
+ QUIET=@
+ ECHO=@echo
+else
+ QUIET=
+ ECHO=@\#
+endif
+export QUIET ECHO
+
+# if DEBUG is enabled, then we do not strip or optimize
+ifeq ($(strip $(DEBUG)),true)
+ CFLAGS += -O1 -g -DDEBUG
+ STRIPCMD = /bin/true -Since_we_are_debugging
+else
+ CFLAGS += $(OPTIMIZATION) -fomit-frame-pointer
+ STRIPCMD = $(STRIP) -s --remove-section=.note --remove-section=.comment
+endif
+
+# if DEBUG is enabled, then we do not strip or optimize
+ifeq ($(strip $(DEBUG)),true)
+ CFLAGS += -O1 -g -DDEBUG
+ STRIPCMD = /bin/true -Since_we_are_debugging
+else
+ CFLAGS += $(OPTIMIZATION) -fomit-frame-pointer
+ STRIPCMD = $(STRIP) -s --remove-section=.note --remove-section=.comment
+endif
+
+# --- ACPIDUMP BEGIN ---
+
+vpath %.c \
+ tools/acpidump
+
+DUMP_OBJS = \
+ acpidump.o
+
+DUMP_OBJS := $(addprefix $(OUTPUT)tools/acpidump/,$(DUMP_OBJS))
+
+$(OUTPUT)acpidump: $(DUMP_OBJS)
+ $(ECHO) " LD " $@
+ $(QUIET) $(LD) $(CFLAGS) $(LDFLAGS) $(DUMP_OBJS) -L$(OUTPUT) -o $@
+ $(QUIET) $(STRIPCMD) $@
+
+$(OUTPUT)tools/acpidump/%.o: %.c
+ $(ECHO) " CC " $@
+ $(QUIET) $(CC) -c $(CFLAGS) -o $@ $<
+
+# --- ACPIDUMP END ---
+
+all: $(OUTPUT)acpidump
+ echo $(OUTPUT)
+
+clean:
+ -find $(OUTPUT) \( -not -type d \) -and \( -name '*~' -o -name '*.[oas]' \) -type f -print \
+ | xargs rm -f
+ -rm -f $(OUTPUT)acpidump
-all: acpidump
-$(PROG) : $(SRCS)
- $(CC) $(CFLAGS) $(SRCS) -o $(PROG)
+install-tools:
+ $(INSTALL) -d $(DESTDIR)${bindir}
+ $(INSTALL_PROGRAM) $(OUTPUT)acpidump $(DESTDIR)${sbindir}
-CLEANFILES= $(PROG)
+install-man:
+ $(INSTALL_DATA) -D man/acpidump.8 $(DESTDIR)${mandir}/man8/acpidump.8
-clean :
- rm -f $(CLEANFILES) $(patsubst %.c,%.o, $(SRCS)) *~
+install: all install-tools install-man
-install :
- install acpidump /usr/sbin/acpidump
- install acpidump.8 /usr/share/man/man8
+uninstall:
+ - rm -f $(DESTDIR)${sbindir}/acpidump
+ - rm -f $(DESTDIR)${mandir}/man8/acpidump.8
+.PHONY: all utils install-tools install-man install uninstall clean
diff --git a/tools/power/acpi/acpidump.8 b/tools/power/acpi/man/acpidump.8
similarity index 100%
rename from tools/power/acpi/acpidump.8
rename to tools/power/acpi/man/acpidump.8
diff --git a/tools/power/acpi/acpidump.c b/tools/power/acpi/tools/acpidump/acpidump.c
similarity index 100%
rename from tools/power/acpi/acpidump.c
rename to tools/power/acpi/tools/acpidump/acpidump.c
--
1.7.10
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 2/3] ACPICA: acpidump: Enable tools Makefile to include acpi tools.
2014-01-15 4:03 ` [PATCH 0/3] ACPI: Integrate tools/power/acpi Makefile into tools Makefile Lv Zheng
2014-01-15 4:04 ` [PATCH 1/3] ACPICA: acpidump: Cleanup tools/power/acpi makefiles Lv Zheng
@ 2014-01-15 4:04 ` Lv Zheng
2014-01-15 4:04 ` [PATCH 3/3] ACPICA: acpidump: Update MAINTAINERS file to include tools folder for ACPI/ACPICA Lv Zheng
` (2 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Lv Zheng @ 2014-01-15 4:04 UTC (permalink / raw)
To: Rafael J. Wysocki, Len Brown; +Cc: Lv Zheng, Lv Zheng, linux-acpi
This patch enables ACPI tool build in the tools/Makefile, so that the ACPI
tools can be built/cleaned/installed along with other tools.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
tools/Makefile | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/tools/Makefile b/tools/Makefile
index a9b0200..ecdc2f8 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -3,6 +3,7 @@ include scripts/Makefile.include
help:
@echo 'Possible targets:'
@echo ''
+ @echo ' acpi - ACPI tools'
@echo ' cgroup - cgroup tools'
@echo ' cpupower - a tool for all things x86 CPU power'
@echo ' firewire - the userspace part of nosy, an IEEE-1394 traffic sniffer'
@@ -33,6 +34,9 @@ help:
@echo ' the respective build directory.'
@echo ' clean: a summary clean target to clean _all_ folders'
+acpi: FORCE
+ $(call descend,power/$@)
+
cpupower: FORCE
$(call descend,power/$@)
@@ -54,6 +58,9 @@ turbostat x86_energy_perf_policy: FORCE
tmon: FORCE
$(call descend,thermal/$@)
+acpi_install:
+ $(call descend,power/$(@:_install=),install)
+
cpupower_install:
$(call descend,power/$(@:_install=),install)
@@ -69,11 +76,14 @@ turbostat_install x86_energy_perf_policy_install:
tmon_install:
$(call descend,thermal/$(@:_install=),install)
-install: cgroup_install cpupower_install firewire_install lguest_install \
+install: acpi_install cgroup_install cpupower_install firewire_install lguest_install \
perf_install selftests_install turbostat_install usb_install \
virtio_install vm_install net_install x86_energy_perf_policy_install \
tmon
+acpi_clean:
+ $(call descend,power/acpi,clean)
+
cpupower_clean:
$(call descend,power/cpupower,clean)
@@ -95,8 +105,8 @@ turbostat_clean x86_energy_perf_policy_clean:
tmon_clean:
$(call descend,thermal/tmon,clean)
-clean: cgroup_clean cpupower_clean firewire_clean lguest_clean perf_clean \
- selftests_clean turbostat_clean usb_clean virtio_clean \
+clean: acpi_clean cgroup_clean cpupower_clean firewire_clean lguest_clean \
+ perf_clean selftests_clean turbostat_clean usb_clean virtio_clean \
vm_clean net_clean x86_energy_perf_policy_clean tmon_clean
.PHONY: FORCE
--
1.7.10
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 3/3] ACPICA: acpidump: Update MAINTAINERS file to include tools folder for ACPI/ACPICA.
2014-01-15 4:03 ` [PATCH 0/3] ACPI: Integrate tools/power/acpi Makefile into tools Makefile Lv Zheng
2014-01-15 4:04 ` [PATCH 1/3] ACPICA: acpidump: Cleanup tools/power/acpi makefiles Lv Zheng
2014-01-15 4:04 ` [PATCH 2/3] ACPICA: acpidump: Enable tools Makefile to include acpi tools Lv Zheng
@ 2014-01-15 4:04 ` Lv Zheng
2014-01-15 17:04 ` [PATCH 0/3] ACPI: Integrate tools/power/acpi Makefile into tools Makefile Al Stone
2014-01-16 1:10 ` Rafael J. Wysocki
4 siblings, 0 replies; 9+ messages in thread
From: Lv Zheng @ 2014-01-15 4:04 UTC (permalink / raw)
To: Rafael J. Wysocki, Len Brown; +Cc: Lv Zheng, Lv Zheng, linux-acpi
This patch updates MAINTAINERS file, adding tools/power/acpi for ACPI and
ACPICA.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
MAINTAINERS | 2 ++
1 file changed, 2 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index 31a0462..b8cae76 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -252,6 +252,7 @@ F: Documentation/ABI/testing/sysfs-bus-acpi
F: drivers/pci/*acpi*
F: drivers/pci/*/*acpi*
F: drivers/pci/*/*/*acpi*
+F: tools/power/acpi
ACPI COMPONENT ARCHITECTURE (ACPICA)
M: Robert Moore <robert.moore@intel.com>
@@ -266,6 +267,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
S: Supported
F: drivers/acpi/acpica/
F: include/acpi/
+F: tools/power/acpi/
ACPI FAN DRIVER
M: Zhang Rui <rui.zhang@intel.com>
--
1.7.10
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 0/3] ACPI: Integrate tools/power/acpi Makefile into tools Makefile.
2014-01-15 4:03 ` [PATCH 0/3] ACPI: Integrate tools/power/acpi Makefile into tools Makefile Lv Zheng
` (2 preceding siblings ...)
2014-01-15 4:04 ` [PATCH 3/3] ACPICA: acpidump: Update MAINTAINERS file to include tools folder for ACPI/ACPICA Lv Zheng
@ 2014-01-15 17:04 ` Al Stone
2014-01-15 21:43 ` Brown, Len
2014-01-16 1:10 ` Rafael J. Wysocki
4 siblings, 1 reply; 9+ messages in thread
From: Al Stone @ 2014-01-15 17:04 UTC (permalink / raw)
To: Lv Zheng, Rafael J. Wysocki, Len Brown; +Cc: Lv Zheng, linux-acpi
On 01/14/2014 09:03 PM, Lv Zheng wrote:
> This patchset updates tools/power/acpi folder to integrate its Makefiles
> with other tools.
>
> Lv Zheng (3):
> ACPICA: acpidump: Cleanup tools/power/acpi makefiles.
> ACPICA: acpidump: Enable tools Makefile to include acpi tools.
> ACPICA: acpidump: Update MAINTAINERS file to include tools folder for
> ACPI/ACPICA.
>
> MAINTAINERS | 2 +
> tools/Makefile | 16 ++-
> tools/power/acpi/Makefile | 149 ++++++++++++++++++++--
> tools/power/acpi/{ => man}/acpidump.8 | 0
> tools/power/acpi/{ => tools/acpidump}/acpidump.c | 0
> 5 files changed, 152 insertions(+), 15 deletions(-)
> rename tools/power/acpi/{ => man}/acpidump.8 (100%)
> rename tools/power/acpi/{ => tools/acpidump}/acpidump.c (100%)
>
Is there any work going on to reconcile (or merge or ...) this
version of acpidump with the version in upstream ACPICA? The
sources are very different yet they seem to me to provide more
or less the same functionality.
--
ciao,
al
-----------------------------------
Al Stone
Software Engineer
Red Hat, Inc.
ahs3@redhat.com
-----------------------------------
^ permalink raw reply [flat|nested] 9+ messages in thread* RE: [PATCH 0/3] ACPI: Integrate tools/power/acpi Makefile into tools Makefile.
2014-01-15 17:04 ` [PATCH 0/3] ACPI: Integrate tools/power/acpi Makefile into tools Makefile Al Stone
@ 2014-01-15 21:43 ` Brown, Len
2014-01-15 21:48 ` Al Stone
0 siblings, 1 reply; 9+ messages in thread
From: Brown, Len @ 2014-01-15 21:43 UTC (permalink / raw)
To: Al Stone, Zheng, Lv, Wysocki, Rafael J
Cc: Lv Zheng, linux-acpi@vger.kernel.org
> Is there any work going on to reconcile (or merge or ...) this
> version of acpidump with the version in upstream ACPICA? The
> sources are very different yet they seem to me to provide more
> or less the same functionality.
Yes, that is exactly what is going on.
The acpidump in the kernel tree today is what we've been using for years.
The acpidump in the ACPICA tree its newly developed replacement.
When we cut over to the new, it will replace the old.
There is no big feature change here -- mostly the idea is
simply that more benefit from sharing the code maintained in the
upstream ACPICA source tree.
cheers,
-Len
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/3] ACPI: Integrate tools/power/acpi Makefile into tools Makefile.
2014-01-15 21:43 ` Brown, Len
@ 2014-01-15 21:48 ` Al Stone
2014-01-16 1:02 ` Zheng, Lv
0 siblings, 1 reply; 9+ messages in thread
From: Al Stone @ 2014-01-15 21:48 UTC (permalink / raw)
To: Brown, Len, Zheng, Lv, Wysocki, Rafael J
Cc: Lv Zheng, linux-acpi@vger.kernel.org
On 01/15/2014 02:43 PM, Brown, Len wrote:
>> Is there any work going on to reconcile (or merge or ...) this
>> version of acpidump with the version in upstream ACPICA? The
>> sources are very different yet they seem to me to provide more
>> or less the same functionality.
>
> Yes, that is exactly what is going on.
> The acpidump in the kernel tree today is what we've been using for years.
Right.
> The acpidump in the ACPICA tree its newly developed replacement.
> When we cut over to the new, it will replace the old.
Ah, okay.
> There is no big feature change here -- mostly the idea is
> simply that more benefit from sharing the code maintained in the
> upstream ACPICA source tree.
>
> cheers,
> -Len
>
Thanks, Len. I suspected that might be the case. That's good to
hear -- it makes my life a little easier maintaining the distro
packages for the ACPCICA user space tools.
--
ciao,
al
-----------------------------------
Al Stone
Software Engineer
Red Hat, Inc.
ahs3@redhat.com
-----------------------------------
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH 0/3] ACPI: Integrate tools/power/acpi Makefile into tools Makefile.
2014-01-15 21:48 ` Al Stone
@ 2014-01-16 1:02 ` Zheng, Lv
0 siblings, 0 replies; 9+ messages in thread
From: Zheng, Lv @ 2014-01-16 1:02 UTC (permalink / raw)
To: Al Stone, Brown, Len, Wysocki, Rafael J
Cc: Lv Zheng, linux-acpi@vger.kernel.org
Hi,
> From: Al Stone [mailto:ahs3@redhat.com]
> Sent: Thursday, January 16, 2014 5:49 AM
>
> On 01/15/2014 02:43 PM, Brown, Len wrote:
> >> Is there any work going on to reconcile (or merge or ...) this
> >> version of acpidump with the version in upstream ACPICA? The
> >> sources are very different yet they seem to me to provide more
> >> or less the same functionality.
> >
> > Yes, that is exactly what is going on.
> > The acpidump in the kernel tree today is what we've been using for years.
>
> Right.
>
> > The acpidump in the ACPICA tree its newly developed replacement.
> > When we cut over to the new, it will replace the old.
>
> Ah, okay.
>
> > There is no big feature change here -- mostly the idea is
> > simply that more benefit from sharing the code maintained in the
> > upstream ACPICA source tree.
> >
> > cheers,
> > -Len
> >
>
> Thanks, Len. I suspected that might be the case. That's good to
> hear -- it makes my life a little easier maintaining the distro
> packages for the ACPCICA user space tools.
I've commits to change ACPICA release scripts to include acpidump.
If they were merged by ACPICA upstream, the acpidump maintained by ACPICA will replace the old one maintained in the kernel tools/power/acpi folder.
And the tools/power/acpi folder will be automatically updated by the ACPICA release cycle from then on.
Thanks and best regards
-Lv
>
> --
> ciao,
> al
> -----------------------------------
> Al Stone
> Software Engineer
> Red Hat, Inc.
> ahs3@redhat.com
> -----------------------------------
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/3] ACPI: Integrate tools/power/acpi Makefile into tools Makefile.
2014-01-15 4:03 ` [PATCH 0/3] ACPI: Integrate tools/power/acpi Makefile into tools Makefile Lv Zheng
` (3 preceding siblings ...)
2014-01-15 17:04 ` [PATCH 0/3] ACPI: Integrate tools/power/acpi Makefile into tools Makefile Al Stone
@ 2014-01-16 1:10 ` Rafael J. Wysocki
4 siblings, 0 replies; 9+ messages in thread
From: Rafael J. Wysocki @ 2014-01-16 1:10 UTC (permalink / raw)
To: Lv Zheng; +Cc: Rafael J. Wysocki, Len Brown, Lv Zheng, linux-acpi
On Wednesday, January 15, 2014 12:03:10 PM Lv Zheng wrote:
> This patchset updates tools/power/acpi folder to integrate its Makefiles
> with other tools.
>
> Lv Zheng (3):
> ACPICA: acpidump: Cleanup tools/power/acpi makefiles.
> ACPICA: acpidump: Enable tools Makefile to include acpi tools.
> ACPICA: acpidump: Update MAINTAINERS file to include tools folder for
> ACPI/ACPICA.
>
> MAINTAINERS | 2 +
> tools/Makefile | 16 ++-
> tools/power/acpi/Makefile | 149 ++++++++++++++++++++--
> tools/power/acpi/{ => man}/acpidump.8 | 0
> tools/power/acpi/{ => tools/acpidump}/acpidump.c | 0
> 5 files changed, 152 insertions(+), 15 deletions(-)
> rename tools/power/acpi/{ => man}/acpidump.8 (100%)
> rename tools/power/acpi/{ => tools/acpidump}/acpidump.c (100%)
Queued up for 3.14, thanks Lv!
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply [flat|nested] 9+ messages in thread