Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756700AbcJMQJu (ORCPT ); Thu, 13 Oct 2016 12:09:50 -0400 Received: from ec2-52-27-115-49.us-west-2.compute.amazonaws.com ([52.27.115.49]:53380 "EHLO s-opensource.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753729AbcJMQJi (ORCPT ); Thu, 13 Oct 2016 12:09:38 -0400 To: torvalds@linux-foundation.org Cc: Jonathan Corbet , Michal Marek , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Shuah Khan From: Shuah Khan Subject: [GIT PULL] Kselftest update for 4.9-rc1 Message-ID: <6cbb45ea-a7cd-553c-cfef-dc13e053d33f@osg.samsung.com> Date: Thu, 13 Oct 2016 10:09:02 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------3C8C2D04C39C12E516C10738" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 426490 Lines: 16524 This is a multi-part message in MIME format. --------------3C8C2D04C39C12E516C10738 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Hi Linus, Please pull the Kselftest update for 4.9-rc1. This update consists of fixes to existing tests. and 17 patch series that moves code from Documentation to selftests, samples, and tools. diff is attached. thanks, -- Shuah --------------------------------------------------------------- The following changes since commit 29b4817d4018df78086157ea3a55c1d9424a7cfc: Linux 4.8-rc1 (2016-08-07 18:18:00 -0700) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux-kselftest-4.9-rc1-update for you to fetch changes up to fecf861e765b2f9ce1a0487c3940afaed80ef7a8: selftests/futex: Check ANSI terminal color support (2016-10-11 07:38:36 -0600) ---------------------------------------------------------------- linux-kselftest-4.9-rc1-update This update consists of: - Fixes and improvements to existing tests - Moving code from Documentation to selftests, samples, and tools. Moves dnotify_test, prctl, ptp, vDSO, ia64, watchdog, and networking tests from Documentation to selftests. Moves mic/mpssd, misc-devices/mei, timers, watchdog, auxdisplay, and blackfin examples from Documentation to samples. Moves accounting, laptops/dslm, and pcmcia/crc32hash tools from Documentation to tools. Deletes BUILD_DOCSRC and its dependencies. ---------------------------------------------------------------- Aleksander Alekseev (1): kselftest: kselftest documentation improvement Christophe JAILLET (1): selftests/timers: Add missing error code assignment before test Fabian Frederick (1): selftests/zram: replace ZRAM_LZ4_COMPRESS SeongJae Park (1): selftests/futex: Check ANSI terminal color support Shuah Khan (17): selftests: move dnotify_test from Documentation/filesystems selftests: move prctl tests from Documentation/prctl selftests: move ptp tests from Documentation/ptp selftests: move vDSO tests from Documentation/vDSO selftests: move ia64 tests from Documentation/ia64 selftests: move watchdog tests from Documentation/watchdog selftests: Move networking/timestamping from Documentation samples: move mic/mpssd example code from Documentation samples: move misc-devices/mei example code from Documentation samples: move timers example code from Documentation samples: move watchdog example code from Documentation samples: move auxdisplay example code from Documentation tools: move accounting tool from Documentation tools: move laptops dslm tool from Documentation tools: move pcmcia crc32hash tool from Documentation samples: move blackfin gptimers-example from Documentation Doc: update 00-INDEX files to reflect the runnable code move Documentation/00-INDEX | 3 ++- Documentation/Makefile | 4 +--- Documentation/accounting/Makefile | 7 ------ Documentation/accounting/delay-accounting.txt | 6 ++--- Documentation/arm/00-INDEX | 2 -- Documentation/auxdisplay/Makefile | 7 ------ Documentation/auxdisplay/cfag12864b | 2 +- Documentation/blackfin/00-INDEX | 4 ---- Documentation/blackfin/Makefile | 5 ---- Documentation/filesystems/00-INDEX | 2 -- Documentation/filesystems/Makefile | 5 ---- Documentation/ia64/Makefile | 5 ---- Documentation/kselftest.txt | 5 ++-- Documentation/laptops/00-INDEX | 4 ---- Documentation/laptops/Makefile | 5 ---- Documentation/laptops/laptop-mode.txt | 2 +- Documentation/mic/Makefile | 1 - Documentation/mic/mpssd/Makefile | 21 ----------------- Documentation/misc-devices/Makefile | 1 - Documentation/misc-devices/mei/Makefile | 5 ---- Documentation/networking/00-INDEX | 2 -- Documentation/networking/Makefile | 1 - Documentation/networking/timestamping/Makefile | 14 ----------- Documentation/pcmcia/Makefile | 7 ------ Documentation/pcmcia/devicetable.txt | 4 ++-- Documentation/prctl/Makefile | 10 -------- Documentation/ptp/Makefile | 8 ------- Documentation/spi/00-INDEX | 2 -- Documentation/timers/00-INDEX | 4 ---- Documentation/timers/Makefile | 5 ---- Documentation/timers/hpet.txt | 2 +- Documentation/vDSO/Makefile | 17 -------------- Documentation/watchdog/Makefile | 1 - Documentation/watchdog/src/Makefile | 5 ---- Documentation/watchdog/watchdog-api.txt | 2 +- Documentation/watchdog/wdt.txt | 2 +- MAINTAINERS | 2 ++ Makefile | 3 --- drivers/media/v4l2-core/Kconfig | 2 +- lib/Kconfig.debug | 9 -------- samples/Kconfig | 6 +++++ samples/Makefile | 2 +- {Documentation => samples}/auxdisplay/.gitignore | 0 samples/auxdisplay/Makefile | 9 ++++++++ .../auxdisplay/cfag12864b-example.c | 0 samples/blackfin/Makefile | 1 + .../blackfin/gptimers-example.c | 0 .../misc-devices => samples}/mei/.gitignore | 0 samples/mei/Makefile | 9 ++++++++ {Documentation/misc-devices => samples}/mei/TODO | 0 .../misc-devices => samples}/mei/mei-amt-version.c | 0 {Documentation => samples}/mic/mpssd/.gitignore | 0 samples/mic/mpssd/Makefile | 27 ++++++++++++++++++++++ {Documentation => samples}/mic/mpssd/micctrl | 0 {Documentation => samples}/mic/mpssd/mpss | 0 {Documentation => samples}/mic/mpssd/mpssd.c | 0 {Documentation => samples}/mic/mpssd/mpssd.h | 0 {Documentation => samples}/mic/mpssd/sysfs.c | 0 {Documentation => samples}/timers/.gitignore | 0 samples/timers/Makefile | 15 ++++++++++++ {Documentation => samples}/timers/hpet_example.c | 0 .../watchdog/src => samples/watchdog}/.gitignore | 1 - samples/watchdog/Makefile | 8 +++++++ .../src => samples/watchdog}/watchdog-simple.c | 0 {Documentation => tools}/accounting/.gitignore | 0 tools/accounting/Makefile | 9 ++++++++ {Documentation => tools}/accounting/getdelays.c | 0 .../laptops => tools/laptop/dslm}/.gitignore | 0 tools/laptop/dslm/Makefile | 9 ++++++++ .../laptops => tools/laptop/dslm}/dslm.c | 0 {Documentation => tools}/pcmcia/.gitignore | 0 tools/pcmcia/Makefile | 9 ++++++++ {Documentation => tools}/pcmcia/crc32hash.c | 0 .../testing/selftests}/filesystems/.gitignore | 0 tools/testing/selftests/filesystems/Makefile | 7 ++++++ .../testing/selftests}/filesystems/dnotify_test.c | 0 tools/testing/selftests/futex/functional/run.sh | 2 +- tools/testing/selftests/futex/run.sh | 2 +- .../testing/selftests}/ia64/.gitignore | 0 tools/testing/selftests/ia64/Makefile | 8 +++++++ .../testing/selftests}/ia64/aliasing-test.c | 0 .../selftests}/networking/timestamping/.gitignore | 0 .../selftests/networking/timestamping/Makefile | 8 +++++++ .../networking/timestamping/hwtstamp_config.c | 0 .../networking/timestamping/timestamping.c | 0 .../networking/timestamping/txtimestamp.c | 0 .../testing/selftests}/prctl/.gitignore | 0 tools/testing/selftests/prctl/Makefile | 15 ++++++++++++ .../prctl/disable-tsc-ctxt-sw-stress-test.c | 0 .../prctl/disable-tsc-on-off-stress-test.c | 0 .../testing/selftests}/prctl/disable-tsc-test.c | 0 .../testing/selftests}/ptp/.gitignore | 0 tools/testing/selftests/ptp/Makefile | 8 +++++++ .../testing/selftests}/ptp/testptp.c | 0 .../testing/selftests}/ptp/testptp.mk | 0 tools/testing/selftests/timers/posix_timers.c | 4 ++-- .../testing/selftests}/vDSO/.gitignore | 0 tools/testing/selftests/vDSO/Makefile | 20 ++++++++++++++++ .../testing/selftests}/vDSO/parse_vdso.c | 0 .../selftests}/vDSO/vdso_standalone_test_x86.c | 0 .../testing/selftests}/vDSO/vdso_test.c | 0 tools/testing/selftests/watchdog/.gitignore | 1 + tools/testing/selftests/watchdog/Makefile | 8 +++++++ .../testing/selftests/watchdog}/watchdog-test.c | 0 tools/testing/selftests/zram/README | 2 +- 105 files changed, 202 insertions(+), 186 deletions(-) delete mode 100644 Documentation/accounting/Makefile delete mode 100644 Documentation/auxdisplay/Makefile delete mode 100644 Documentation/blackfin/Makefile delete mode 100644 Documentation/filesystems/Makefile delete mode 100644 Documentation/ia64/Makefile delete mode 100644 Documentation/laptops/Makefile delete mode 100644 Documentation/mic/Makefile delete mode 100644 Documentation/mic/mpssd/Makefile delete mode 100644 Documentation/misc-devices/Makefile delete mode 100644 Documentation/misc-devices/mei/Makefile delete mode 100644 Documentation/networking/Makefile delete mode 100644 Documentation/networking/timestamping/Makefile delete mode 100644 Documentation/pcmcia/Makefile delete mode 100644 Documentation/prctl/Makefile delete mode 100644 Documentation/ptp/Makefile delete mode 100644 Documentation/timers/Makefile delete mode 100644 Documentation/vDSO/Makefile delete mode 100644 Documentation/watchdog/Makefile delete mode 100644 Documentation/watchdog/src/Makefile rename {Documentation => samples}/auxdisplay/.gitignore (100%) create mode 100644 samples/auxdisplay/Makefile rename {Documentation => samples}/auxdisplay/cfag12864b-example.c (100%) create mode 100644 samples/blackfin/Makefile rename {Documentation => samples}/blackfin/gptimers-example.c (100%) rename {Documentation/misc-devices => samples}/mei/.gitignore (100%) create mode 100644 samples/mei/Makefile rename {Documentation/misc-devices => samples}/mei/TODO (100%) rename {Documentation/misc-devices => samples}/mei/mei-amt-version.c (100%) rename {Documentation => samples}/mic/mpssd/.gitignore (100%) create mode 100644 samples/mic/mpssd/Makefile rename {Documentation => samples}/mic/mpssd/micctrl (100%) rename {Documentation => samples}/mic/mpssd/mpss (100%) rename {Documentation => samples}/mic/mpssd/mpssd.c (100%) rename {Documentation => samples}/mic/mpssd/mpssd.h (100%) rename {Documentation => samples}/mic/mpssd/sysfs.c (100%) rename {Documentation => samples}/timers/.gitignore (100%) create mode 100644 samples/timers/Makefile rename {Documentation => samples}/timers/hpet_example.c (100%) rename {Documentation/watchdog/src => samples/watchdog}/.gitignore (53%) create mode 100644 samples/watchdog/Makefile rename {Documentation/watchdog/src => samples/watchdog}/watchdog-simple.c (100%) rename {Documentation => tools}/accounting/.gitignore (100%) create mode 100644 tools/accounting/Makefile rename {Documentation => tools}/accounting/getdelays.c (100%) rename {Documentation/laptops => tools/laptop/dslm}/.gitignore (100%) create mode 100644 tools/laptop/dslm/Makefile rename {Documentation/laptops => tools/laptop/dslm}/dslm.c (100%) rename {Documentation => tools}/pcmcia/.gitignore (100%) create mode 100644 tools/pcmcia/Makefile rename {Documentation => tools}/pcmcia/crc32hash.c (100%) rename {Documentation => tools/testing/selftests}/filesystems/.gitignore (100%) create mode 100644 tools/testing/selftests/filesystems/Makefile rename {Documentation => tools/testing/selftests}/filesystems/dnotify_test.c (100%) rename {Documentation => tools/testing/selftests}/ia64/.gitignore (100%) create mode 100644 tools/testing/selftests/ia64/Makefile rename {Documentation => tools/testing/selftests}/ia64/aliasing-test.c (100%) rename {Documentation => tools/testing/selftests}/networking/timestamping/.gitignore (100%) create mode 100644 tools/testing/selftests/networking/timestamping/Makefile rename {Documentation => tools/testing/selftests}/networking/timestamping/hwtstamp_config.c (100%) rename {Documentation => tools/testing/selftests}/networking/timestamping/timestamping.c (100%) rename {Documentation => tools/testing/selftests}/networking/timestamping/txtimestamp.c (100%) rename {Documentation => tools/testing/selftests}/prctl/.gitignore (100%) create mode 100644 tools/testing/selftests/prctl/Makefile rename {Documentation => tools/testing/selftests}/prctl/disable-tsc-ctxt-sw-stress-test.c (100%) rename {Documentation => tools/testing/selftests}/prctl/disable-tsc-on-off-stress-test.c (100%) rename {Documentation => tools/testing/selftests}/prctl/disable-tsc-test.c (100%) rename {Documentation => tools/testing/selftests}/ptp/.gitignore (100%) create mode 100644 tools/testing/selftests/ptp/Makefile rename {Documentation => tools/testing/selftests}/ptp/testptp.c (100%) rename {Documentation => tools/testing/selftests}/ptp/testptp.mk (100%) rename {Documentation => tools/testing/selftests}/vDSO/.gitignore (100%) create mode 100644 tools/testing/selftests/vDSO/Makefile rename {Documentation => tools/testing/selftests}/vDSO/parse_vdso.c (100%) rename {Documentation => tools/testing/selftests}/vDSO/vdso_standalone_test_x86.c (100%) rename {Documentation => tools/testing/selftests}/vDSO/vdso_test.c (100%) create mode 100644 tools/testing/selftests/watchdog/.gitignore create mode 100644 tools/testing/selftests/watchdog/Makefile rename {Documentation/watchdog/src => tools/testing/selftests/watchdog}/watchdog-test.c (100%) --------------------------------------------------------------- -- Shuah Khan Sr. Linux Kernel Developer Open Source Innovation Group Samsung Research America (Silicon Valley) shuahkh@osg.samsung.com --------------3C8C2D04C39C12E516C10738 Content-Type: text/x-patch; name="4.9-rc1_update.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="4.9-rc1_update.diff" diff --git a/Documentation/00-INDEX b/Documentation/00-INDEX index cb9a6c6..3acc4f1 100644 --- a/Documentation/00-INDEX +++ b/Documentation/00-INDEX @@ -46,7 +46,8 @@ IRQ.txt Intel-IOMMU.txt - basic info on the Intel IOMMU virtualization support. Makefile - - some files in Documentation dir are actually sample code to build + - This file does nothing. Removing it breaks make htmldocs and + make distclean. ManagementStyle - how to (attempt to) manage kernel hackers. RCU/ diff --git a/Documentation/Makefile b/Documentation/Makefile index de955e1..c2a4691 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -1,3 +1 @@ -subdir-y :=3D accounting auxdisplay blackfin \ - filesystems filesystems ia64 laptops mic misc-devices \ - networking pcmcia prctl ptp timers vDSO watchdog +subdir-y :=3D diff --git a/Documentation/accounting/.gitignore b/Documentation/accounti= ng/.gitignore deleted file mode 100644 index 8648520..0000000 --- a/Documentation/accounting/.gitignore +++ /dev/null @@ -1 +0,0 @@ -getdelays diff --git a/Documentation/accounting/Makefile b/Documentation/accounting= /Makefile deleted file mode 100644 index 7e232cb..0000000 --- a/Documentation/accounting/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# List of programs to build -hostprogs-y :=3D getdelays - -# Tell kbuild to always build the programs -always :=3D $(hostprogs-y) - -HOSTCFLAGS_getdelays.o +=3D -I$(objtree)/usr/include diff --git a/Documentation/accounting/delay-accounting.txt b/Documentatio= n/accounting/delay-accounting.txt index 8a12f07..042ea59 100644 --- a/Documentation/accounting/delay-accounting.txt +++ b/Documentation/accounting/delay-accounting.txt @@ -54,9 +54,9 @@ are sent to userspace without requiring a command. If i= t is the last exiting task of a thread group, the per-tgid statistics are also sent. More deta= ils are given in the taskstats interface description. =20 -The getdelays.c userspace utility in this directory allows simple comman= ds to -be run and the corresponding delay statistics to be displayed. It also s= erves -as an example of using the taskstats interface. +The getdelays.c userspace utility in tools/accounting directory allows s= imple +commands to be run and the corresponding delay statistics to be displaye= d. It +also serves as an example of using the taskstats interface. =20 Usage ----- diff --git a/Documentation/accounting/getdelays.c b/Documentation/account= ing/getdelays.c deleted file mode 100644 index b5ca536..0000000 --- a/Documentation/accounting/getdelays.c +++ /dev/null @@ -1,550 +0,0 @@ -/* getdelays.c - * - * Utility to get per-pid and per-tgid delay accounting statistics - * Also illustrates usage of the taskstats interface - * - * Copyright (C) Shailabh Nagar, IBM Corp. 2005 - * Copyright (C) Balbir Singh, IBM Corp. 2006 - * Copyright (c) Jay Lan, SGI. 2006 - * - * Compile with - * gcc -I/usr/src/linux/include getdelays.c -o getdelays - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -/* - * Generic macros for dealing with netlink sockets. Might be duplicated - * elsewhere. It is recommended that commercial grade applications use - * libnl or libnetlink and use the interfaces provided by the library - */ -#define GENLMSG_DATA(glh) ((void *)(NLMSG_DATA(glh) + GENL_HDRLEN)) -#define GENLMSG_PAYLOAD(glh) (NLMSG_PAYLOAD(glh, 0) - GENL_HDRLEN) -#define NLA_DATA(na) ((void *)((char*)(na) + NLA_HDRLEN)) -#define NLA_PAYLOAD(len) (len - NLA_HDRLEN) - -#define err(code, fmt, arg...) \ - do { \ - fprintf(stderr, fmt, ##arg); \ - exit(code); \ - } while (0) - -int done; -int rcvbufsz; -char name[100]; -int dbg; -int print_delays; -int print_io_accounting; -int print_task_context_switch_counts; - -#define PRINTF(fmt, arg...) { \ - if (dbg) { \ - printf(fmt, ##arg); \ - } \ - } - -/* Maximum size of response requested or message sent */ -#define MAX_MSG_SIZE 1024 -/* Maximum number of cpus expected to be specified in a cpumask */ -#define MAX_CPUS 32 - -struct msgtemplate { - struct nlmsghdr n; - struct genlmsghdr g; - char buf[MAX_MSG_SIZE]; -}; - -char cpumask[100+6*MAX_CPUS]; - -static void usage(void) -{ - fprintf(stderr, "getdelays [-dilv] [-w logfile] [-r bufsize] " - "[-m cpumask] [-t tgid] [-p pid]\n"); - fprintf(stderr, " -d: print delayacct stats\n"); - fprintf(stderr, " -i: print IO accounting (works only with -p)\n"); - fprintf(stderr, " -l: listen forever\n"); - fprintf(stderr, " -v: debug on\n"); - fprintf(stderr, " -C: container path\n"); -} - -/* - * Create a raw netlink socket and bind - */ -static int create_nl_socket(int protocol) -{ - int fd; - struct sockaddr_nl local; - - fd =3D socket(AF_NETLINK, SOCK_RAW, protocol); - if (fd < 0) - return -1; - - if (rcvbufsz) - if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, - &rcvbufsz, sizeof(rcvbufsz)) < 0) { - fprintf(stderr, "Unable to set socket rcv buf size to %d\n", - rcvbufsz); - goto error; - } - - memset(&local, 0, sizeof(local)); - local.nl_family =3D AF_NETLINK; - - if (bind(fd, (struct sockaddr *) &local, sizeof(local)) < 0) - goto error; - - return fd; -error: - close(fd); - return -1; -} - - -static int send_cmd(int sd, __u16 nlmsg_type, __u32 nlmsg_pid, - __u8 genl_cmd, __u16 nla_type, - void *nla_data, int nla_len) -{ - struct nlattr *na; - struct sockaddr_nl nladdr; - int r, buflen; - char *buf; - - struct msgtemplate msg; - - msg.n.nlmsg_len =3D NLMSG_LENGTH(GENL_HDRLEN); - msg.n.nlmsg_type =3D nlmsg_type; - msg.n.nlmsg_flags =3D NLM_F_REQUEST; - msg.n.nlmsg_seq =3D 0; - msg.n.nlmsg_pid =3D nlmsg_pid; - msg.g.cmd =3D genl_cmd; - msg.g.version =3D 0x1; - na =3D (struct nlattr *) GENLMSG_DATA(&msg); - na->nla_type =3D nla_type; - na->nla_len =3D nla_len + 1 + NLA_HDRLEN; - memcpy(NLA_DATA(na), nla_data, nla_len); - msg.n.nlmsg_len +=3D NLMSG_ALIGN(na->nla_len); - - buf =3D (char *) &msg; - buflen =3D msg.n.nlmsg_len ; - memset(&nladdr, 0, sizeof(nladdr)); - nladdr.nl_family =3D AF_NETLINK; - while ((r =3D sendto(sd, buf, buflen, 0, (struct sockaddr *) &nladdr, - sizeof(nladdr))) < buflen) { - if (r > 0) { - buf +=3D r; - buflen -=3D r; - } else if (errno !=3D EAGAIN) - return -1; - } - return 0; -} - - -/* - * Probe the controller in genetlink to find the family id - * for the TASKSTATS family - */ -static int get_family_id(int sd) -{ - struct { - struct nlmsghdr n; - struct genlmsghdr g; - char buf[256]; - } ans; - - int id =3D 0, rc; - struct nlattr *na; - int rep_len; - - strcpy(name, TASKSTATS_GENL_NAME); - rc =3D send_cmd(sd, GENL_ID_CTRL, getpid(), CTRL_CMD_GETFAMILY, - CTRL_ATTR_FAMILY_NAME, (void *)name, - strlen(TASKSTATS_GENL_NAME)+1); - if (rc < 0) - return 0; /* sendto() failure? */ - - rep_len =3D recv(sd, &ans, sizeof(ans), 0); - if (ans.n.nlmsg_type =3D=3D NLMSG_ERROR || - (rep_len < 0) || !NLMSG_OK((&ans.n), rep_len)) - return 0; - - na =3D (struct nlattr *) GENLMSG_DATA(&ans); - na =3D (struct nlattr *) ((char *) na + NLA_ALIGN(na->nla_len)); - if (na->nla_type =3D=3D CTRL_ATTR_FAMILY_ID) { - id =3D *(__u16 *) NLA_DATA(na); - } - return id; -} - -#define average_ms(t, c) (t / 1000000ULL / (c ? c : 1)) - -static void print_delayacct(struct taskstats *t) -{ - printf("\n\nCPU %15s%15s%15s%15s%15s\n" - " %15llu%15llu%15llu%15llu%15.3fms\n" - "IO %15s%15s%15s\n" - " %15llu%15llu%15llums\n" - "SWAP %15s%15s%15s\n" - " %15llu%15llu%15llums\n" - "RECLAIM %12s%15s%15s\n" - " %15llu%15llu%15llums\n", - "count", "real total", "virtual total", - "delay total", "delay average", - (unsigned long long)t->cpu_count, - (unsigned long long)t->cpu_run_real_total, - (unsigned long long)t->cpu_run_virtual_total, - (unsigned long long)t->cpu_delay_total, - average_ms((double)t->cpu_delay_total, t->cpu_count), - "count", "delay total", "delay average", - (unsigned long long)t->blkio_count, - (unsigned long long)t->blkio_delay_total, - average_ms(t->blkio_delay_total, t->blkio_count), - "count", "delay total", "delay average", - (unsigned long long)t->swapin_count, - (unsigned long long)t->swapin_delay_total, - average_ms(t->swapin_delay_total, t->swapin_count), - "count", "delay total", "delay average", - (unsigned long long)t->freepages_count, - (unsigned long long)t->freepages_delay_total, - average_ms(t->freepages_delay_total, t->freepages_count)); -} - -static void task_context_switch_counts(struct taskstats *t) -{ - printf("\n\nTask %15s%15s\n" - " %15llu%15llu\n", - "voluntary", "nonvoluntary", - (unsigned long long)t->nvcsw, (unsigned long long)t->nivcsw); -} - -static void print_cgroupstats(struct cgroupstats *c) -{ - printf("sleeping %llu, blocked %llu, running %llu, stopped %llu, " - "uninterruptible %llu\n", (unsigned long long)c->nr_sleeping, - (unsigned long long)c->nr_io_wait, - (unsigned long long)c->nr_running, - (unsigned long long)c->nr_stopped, - (unsigned long long)c->nr_uninterruptible); -} - - -static void print_ioacct(struct taskstats *t) -{ - printf("%s: read=3D%llu, write=3D%llu, cancelled_write=3D%llu\n", - t->ac_comm, - (unsigned long long)t->read_bytes, - (unsigned long long)t->write_bytes, - (unsigned long long)t->cancelled_write_bytes); -} - -int main(int argc, char *argv[]) -{ - int c, rc, rep_len, aggr_len, len2; - int cmd_type =3D TASKSTATS_CMD_ATTR_UNSPEC; - __u16 id; - __u32 mypid; - - struct nlattr *na; - int nl_sd =3D -1; - int len =3D 0; - pid_t tid =3D 0; - pid_t rtid =3D 0; - - int fd =3D 0; - int count =3D 0; - int write_file =3D 0; - int maskset =3D 0; - char *logfile =3D NULL; - int loop =3D 0; - int containerset =3D 0; - char *containerpath =3D NULL; - int cfd =3D 0; - int forking =3D 0; - sigset_t sigset; - - struct msgtemplate msg; - - while (!forking) { - c =3D getopt(argc, argv, "qdiw:r:m:t:p:vlC:c:"); - if (c < 0) - break; - - switch (c) { - case 'd': - printf("print delayacct stats ON\n"); - print_delays =3D 1; - break; - case 'i': - printf("printing IO accounting\n"); - print_io_accounting =3D 1; - break; - case 'q': - printf("printing task/process context switch rates\n"); - print_task_context_switch_counts =3D 1; - break; - case 'C': - containerset =3D 1; - containerpath =3D optarg; - break; - case 'w': - logfile =3D strdup(optarg); - printf("write to file %s\n", logfile); - write_file =3D 1; - break; - case 'r': - rcvbufsz =3D atoi(optarg); - printf("receive buf size %d\n", rcvbufsz); - if (rcvbufsz < 0) - err(1, "Invalid rcv buf size\n"); - break; - case 'm': - strncpy(cpumask, optarg, sizeof(cpumask)); - cpumask[sizeof(cpumask) - 1] =3D '\0'; - maskset =3D 1; - printf("cpumask %s maskset %d\n", cpumask, maskset); - break; - case 't': - tid =3D atoi(optarg); - if (!tid) - err(1, "Invalid tgid\n"); - cmd_type =3D TASKSTATS_CMD_ATTR_TGID; - break; - case 'p': - tid =3D atoi(optarg); - if (!tid) - err(1, "Invalid pid\n"); - cmd_type =3D TASKSTATS_CMD_ATTR_PID; - break; - case 'c': - - /* Block SIGCHLD for sigwait() later */ - if (sigemptyset(&sigset) =3D=3D -1) - err(1, "Failed to empty sigset"); - if (sigaddset(&sigset, SIGCHLD)) - err(1, "Failed to set sigchld in sigset"); - sigprocmask(SIG_BLOCK, &sigset, NULL); - - /* fork/exec a child */ - tid =3D fork(); - if (tid < 0) - err(1, "Fork failed\n"); - if (tid =3D=3D 0) - if (execvp(argv[optind - 1], - &argv[optind - 1]) < 0) - exit(-1); - - /* Set the command type and avoid further processing */ - cmd_type =3D TASKSTATS_CMD_ATTR_PID; - forking =3D 1; - break; - case 'v': - printf("debug on\n"); - dbg =3D 1; - break; - case 'l': - printf("listen forever\n"); - loop =3D 1; - break; - default: - usage(); - exit(-1); - } - } - - if (write_file) { - fd =3D open(logfile, O_WRONLY | O_CREAT | O_TRUNC, - S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); - if (fd =3D=3D -1) { - perror("Cannot open output file\n"); - exit(1); - } - } - - nl_sd =3D create_nl_socket(NETLINK_GENERIC); - if (nl_sd < 0) - err(1, "error creating Netlink socket\n"); - - - mypid =3D getpid(); - id =3D get_family_id(nl_sd); - if (!id) { - fprintf(stderr, "Error getting family id, errno %d\n", errno); - goto err; - } - PRINTF("family id %d\n", id); - - if (maskset) { - rc =3D send_cmd(nl_sd, id, mypid, TASKSTATS_CMD_GET, - TASKSTATS_CMD_ATTR_REGISTER_CPUMASK, - &cpumask, strlen(cpumask) + 1); - PRINTF("Sent register cpumask, retval %d\n", rc); - if (rc < 0) { - fprintf(stderr, "error sending register cpumask\n"); - goto err; - } - } - - if (tid && containerset) { - fprintf(stderr, "Select either -t or -C, not both\n"); - goto err; - } - - /* - * If we forked a child, wait for it to exit. Cannot use waitpid() - * as all the delicious data would be reaped as part of the wait - */ - if (tid && forking) { - int sig_received; - sigwait(&sigset, &sig_received); - } - - if (tid) { - rc =3D send_cmd(nl_sd, id, mypid, TASKSTATS_CMD_GET, - cmd_type, &tid, sizeof(__u32)); - PRINTF("Sent pid/tgid, retval %d\n", rc); - if (rc < 0) { - fprintf(stderr, "error sending tid/tgid cmd\n"); - goto done; - } - } - - if (containerset) { - cfd =3D open(containerpath, O_RDONLY); - if (cfd < 0) { - perror("error opening container file"); - goto err; - } - rc =3D send_cmd(nl_sd, id, mypid, CGROUPSTATS_CMD_GET, - CGROUPSTATS_CMD_ATTR_FD, &cfd, sizeof(__u32)); - if (rc < 0) { - perror("error sending cgroupstats command"); - goto err; - } - } - if (!maskset && !tid && !containerset) { - usage(); - goto err; - } - - do { - rep_len =3D recv(nl_sd, &msg, sizeof(msg), 0); - PRINTF("received %d bytes\n", rep_len); - - if (rep_len < 0) { - fprintf(stderr, "nonfatal reply error: errno %d\n", - errno); - continue; - } - if (msg.n.nlmsg_type =3D=3D NLMSG_ERROR || - !NLMSG_OK((&msg.n), rep_len)) { - struct nlmsgerr *err =3D NLMSG_DATA(&msg); - fprintf(stderr, "fatal reply error, errno %d\n", - err->error); - goto done; - } - - PRINTF("nlmsghdr size=3D%zu, nlmsg_len=3D%d, rep_len=3D%d\n", - sizeof(struct nlmsghdr), msg.n.nlmsg_len, rep_len); - - - rep_len =3D GENLMSG_PAYLOAD(&msg.n); - - na =3D (struct nlattr *) GENLMSG_DATA(&msg); - len =3D 0; - while (len < rep_len) { - len +=3D NLA_ALIGN(na->nla_len); - switch (na->nla_type) { - case TASKSTATS_TYPE_AGGR_TGID: - /* Fall through */ - case TASKSTATS_TYPE_AGGR_PID: - aggr_len =3D NLA_PAYLOAD(na->nla_len); - len2 =3D 0; - /* For nested attributes, na follows */ - na =3D (struct nlattr *) NLA_DATA(na); - done =3D 0; - while (len2 < aggr_len) { - switch (na->nla_type) { - case TASKSTATS_TYPE_PID: - rtid =3D *(int *) NLA_DATA(na); - if (print_delays) - printf("PID\t%d\n", rtid); - break; - case TASKSTATS_TYPE_TGID: - rtid =3D *(int *) NLA_DATA(na); - if (print_delays) - printf("TGID\t%d\n", rtid); - break; - case TASKSTATS_TYPE_STATS: - count++; - if (print_delays) - print_delayacct((struct taskstats *) NLA_DATA(na)); - if (print_io_accounting) - print_ioacct((struct taskstats *) NLA_DATA(na)); - if (print_task_context_switch_counts) - task_context_switch_counts((struct taskstats *) NLA_DATA(na)); - if (fd) { - if (write(fd, NLA_DATA(na), na->nla_len) < 0) { - err(1,"write error\n"); - } - } - if (!loop) - goto done; - break; - case TASKSTATS_TYPE_NULL: - break; - default: - fprintf(stderr, "Unknown nested" - " nla_type %d\n", - na->nla_type); - break; - } - len2 +=3D NLA_ALIGN(na->nla_len); - na =3D (struct nlattr *)((char *)na + - NLA_ALIGN(na->nla_len)); - } - break; - - case CGROUPSTATS_TYPE_CGROUP_STATS: - print_cgroupstats(NLA_DATA(na)); - break; - default: - fprintf(stderr, "Unknown nla_type %d\n", - na->nla_type); - case TASKSTATS_TYPE_NULL: - break; - } - na =3D (struct nlattr *) (GENLMSG_DATA(&msg) + len); - } - } while (loop); -done: - if (maskset) { - rc =3D send_cmd(nl_sd, id, mypid, TASKSTATS_CMD_GET, - TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK, - &cpumask, strlen(cpumask) + 1); - printf("Sent deregister mask, retval %d\n", rc); - if (rc < 0) - err(rc, "error sending deregister cpumask\n"); - } -err: - close(nl_sd); - if (fd) - close(fd); - if (cfd) - close(cfd); - return 0; -} diff --git a/Documentation/arm/00-INDEX b/Documentation/arm/00-INDEX index dea011c..b6e69fd 100644 --- a/Documentation/arm/00-INDEX +++ b/Documentation/arm/00-INDEX @@ -8,8 +8,6 @@ Interrupts - ARM Interrupt subsystem documentation IXP4xx - Intel IXP4xx Network processor. -Makefile - - Build sourcefiles as part of the Documentation-build for arm Netwinder - Netwinder specific documentation Porting diff --git a/Documentation/auxdisplay/.gitignore b/Documentation/auxdispl= ay/.gitignore deleted file mode 100644 index 7af2228..0000000 --- a/Documentation/auxdisplay/.gitignore +++ /dev/null @@ -1 +0,0 @@ -cfag12864b-example diff --git a/Documentation/auxdisplay/Makefile b/Documentation/auxdisplay= /Makefile deleted file mode 100644 index ada4dac..0000000 --- a/Documentation/auxdisplay/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# List of programs to build -hostprogs-y :=3D cfag12864b-example - -# Tell kbuild to always build the programs -always :=3D $(hostprogs-y) - -HOSTCFLAGS_cfag12864b-example.o +=3D -I$(objtree)/usr/include diff --git a/Documentation/auxdisplay/cfag12864b b/Documentation/auxdispl= ay/cfag12864b index eb7be39..12fd51b 100644 --- a/Documentation/auxdisplay/cfag12864b +++ b/Documentation/auxdisplay/cfag12864b @@ -101,5 +101,5 @@ Although the LCD won't get updated until the next ref= resh time arrives. Also, you can mmap the framebuffer: open & mmap, munmap & close... which is the best option for most uses. =20 -Check Documentation/auxdisplay/cfag12864b-example.c +Check samples/auxdisplay/cfag12864b-example.c for a real working userspace complete program with usage examples. diff --git a/Documentation/auxdisplay/cfag12864b-example.c b/Documentatio= n/auxdisplay/cfag12864b-example.c deleted file mode 100644 index e7823ff..0000000 --- a/Documentation/auxdisplay/cfag12864b-example.c +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Filename: cfag12864b-example.c - * Version: 0.1.0 - * Description: cfag12864b LCD userspace example program - * License: GPLv2 - * - * Author: Copyright (C) Miguel Ojeda Sandonis - * Date: 2006-10-31 - * - * This program is free software; you can redistribute it and/or modify= - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307= USA - * - */ - -/* - * ------------------------ - * start of cfag12864b code - * ------------------------ - */ - -#include -#include -#include -#include -#include -#include - -#define CFAG12864B_WIDTH (128) -#define CFAG12864B_HEIGHT (64) -#define CFAG12864B_SIZE (128 * 64 / 8) -#define CFAG12864B_BPB (8) -#define CFAG12864B_ADDRESS(x, y) ((y) * CFAG12864B_WIDTH / \ - CFAG12864B_BPB + (x) / CFAG12864B_BPB) -#define CFAG12864B_BIT(n) (((unsigned char) 1) << (n)) - -#undef CFAG12864B_DOCHECK -#ifdef CFAG12864B_DOCHECK - #define CFAG12864B_CHECK(x, y) ((x) < CFAG12864B_WIDTH && \ - (y) < CFAG12864B_HEIGHT) -#else - #define CFAG12864B_CHECK(x, y) (1) -#endif - -int cfag12864b_fd; -unsigned char * cfag12864b_mem; -unsigned char cfag12864b_buffer[CFAG12864B_SIZE]; - -/* - * init a cfag12864b framebuffer device - * - * No error: return =3D 0 - * Unable to open: return =3D -1 - * Unable to mmap: return =3D -2 - */ -static int cfag12864b_init(char *path) -{ - cfag12864b_fd =3D open(path, O_RDWR); - if (cfag12864b_fd =3D=3D -1) - return -1; - - cfag12864b_mem =3D mmap(0, CFAG12864B_SIZE, PROT_READ | PROT_WRITE, - MAP_SHARED, cfag12864b_fd, 0); - if (cfag12864b_mem =3D=3D MAP_FAILED) { - close(cfag12864b_fd); - return -2; - } - - return 0; -} - -/* - * exit a cfag12864b framebuffer device - */ -static void cfag12864b_exit(void) -{ - munmap(cfag12864b_mem, CFAG12864B_SIZE); - close(cfag12864b_fd); -} - -/* - * set (x, y) pixel - */ -static void cfag12864b_set(unsigned char x, unsigned char y) -{ - if (CFAG12864B_CHECK(x, y)) - cfag12864b_buffer[CFAG12864B_ADDRESS(x, y)] |=3D - CFAG12864B_BIT(x % CFAG12864B_BPB); -} - -/* - * unset (x, y) pixel - */ -static void cfag12864b_unset(unsigned char x, unsigned char y) -{ - if (CFAG12864B_CHECK(x, y)) - cfag12864b_buffer[CFAG12864B_ADDRESS(x, y)] &=3D - ~CFAG12864B_BIT(x % CFAG12864B_BPB); -} - -/* - * is set (x, y) pixel? - * - * Pixel off: return =3D 0 - * Pixel on: return =3D 1 - */ -static unsigned char cfag12864b_isset(unsigned char x, unsigned char y) -{ - if (CFAG12864B_CHECK(x, y)) - if (cfag12864b_buffer[CFAG12864B_ADDRESS(x, y)] & - CFAG12864B_BIT(x % CFAG12864B_BPB)) - return 1; - - return 0; -} - -/* - * not (x, y) pixel - */ -static void cfag12864b_not(unsigned char x, unsigned char y) -{ - if (cfag12864b_isset(x, y)) - cfag12864b_unset(x, y); - else - cfag12864b_set(x, y); -} - -/* - * fill (set all pixels) - */ -static void cfag12864b_fill(void) -{ - unsigned short i; - - for (i =3D 0; i < CFAG12864B_SIZE; i++) - cfag12864b_buffer[i] =3D 0xFF; -} - -/* - * clear (unset all pixels) - */ -static void cfag12864b_clear(void) -{ - unsigned short i; - - for (i =3D 0; i < CFAG12864B_SIZE; i++) - cfag12864b_buffer[i] =3D 0; -} - -/* - * format a [128*64] matrix - * - * Pixel off: src[i] =3D 0 - * Pixel on: src[i] > 0 - */ -static void cfag12864b_format(unsigned char * matrix) -{ - unsigned char i, j, n; - - for (i =3D 0; i < CFAG12864B_HEIGHT; i++) - for (j =3D 0; j < CFAG12864B_WIDTH / CFAG12864B_BPB; j++) { - cfag12864b_buffer[i * CFAG12864B_WIDTH / CFAG12864B_BPB + - j] =3D 0; - for (n =3D 0; n < CFAG12864B_BPB; n++) - if (matrix[i * CFAG12864B_WIDTH + - j * CFAG12864B_BPB + n]) - cfag12864b_buffer[i * CFAG12864B_WIDTH / - CFAG12864B_BPB + j] |=3D - CFAG12864B_BIT(n); - } -} - -/* - * blit buffer to lcd - */ -static void cfag12864b_blit(void) -{ - memcpy(cfag12864b_mem, cfag12864b_buffer, CFAG12864B_SIZE); -} - -/* - * ---------------------- - * end of cfag12864b code - * ---------------------- - */ - -#include - -#define EXAMPLES 6 - -static void example(unsigned char n) -{ - unsigned short i, j; - unsigned char matrix[CFAG12864B_WIDTH * CFAG12864B_HEIGHT]; - - if (n > EXAMPLES) - return; - - printf("Example %i/%i - ", n, EXAMPLES); - - switch (n) { - case 1: - printf("Draw points setting bits"); - cfag12864b_clear(); - for (i =3D 0; i < CFAG12864B_WIDTH; i +=3D 2) - for (j =3D 0; j < CFAG12864B_HEIGHT; j +=3D 2) - cfag12864b_set(i, j); - break; - - case 2: - printf("Clear the LCD"); - cfag12864b_clear(); - break; - - case 3: - printf("Draw rows formatting a [128*64] matrix"); - memset(matrix, 0, CFAG12864B_WIDTH * CFAG12864B_HEIGHT); - for (i =3D 0; i < CFAG12864B_WIDTH; i++) - for (j =3D 0; j < CFAG12864B_HEIGHT; j +=3D 2) - matrix[j * CFAG12864B_WIDTH + i] =3D 1; - cfag12864b_format(matrix); - break; - - case 4: - printf("Fill the lcd"); - cfag12864b_fill(); - break; - - case 5: - printf("Draw columns unsetting bits"); - for (i =3D 0; i < CFAG12864B_WIDTH; i +=3D 2) - for (j =3D 0; j < CFAG12864B_HEIGHT; j++) - cfag12864b_unset(i, j); - break; - - case 6: - printf("Do negative not-ing all bits"); - for (i =3D 0; i < CFAG12864B_WIDTH; i++) - for (j =3D 0; j < CFAG12864B_HEIGHT; j ++) - cfag12864b_not(i, j); - break; - } - - puts(" - [Press Enter]"); -} - -int main(int argc, char *argv[]) -{ - unsigned char n; - - if (argc !=3D 2) { - printf( - "Sintax: %s fbdev\n" - "Usually: /dev/fb0, /dev/fb1...\n", argv[0]); - return -1; - } - - if (cfag12864b_init(argv[1])) { - printf("Can't init %s fbdev\n", argv[1]); - return -2; - } - - for (n =3D 1; n <=3D EXAMPLES; n++) { - example(n); - cfag12864b_blit(); - while (getchar() !=3D '\n'); - } - - cfag12864b_exit(); - - return 0; -} diff --git a/Documentation/blackfin/00-INDEX b/Documentation/blackfin/00-= INDEX index c54fcdd..265a1ef 100644 --- a/Documentation/blackfin/00-INDEX +++ b/Documentation/blackfin/00-INDEX @@ -1,10 +1,6 @@ 00-INDEX - This file -Makefile - - Makefile for gptimers example file. bfin-gpio-notes.txt - Notes in developing/using bfin-gpio driver. bfin-spi-notes.txt - Notes for using bfin spi bus driver. -gptimers-example.c - - gptimers example diff --git a/Documentation/blackfin/Makefile b/Documentation/blackfin/Mak= efile deleted file mode 100644 index 6782c58..0000000 --- a/Documentation/blackfin/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -ifneq ($(CONFIG_BLACKFIN),) -ifneq ($(CONFIG_BFIN_GPTIMERS),) -obj-m :=3D gptimers-example.o -endif -endif diff --git a/Documentation/blackfin/gptimers-example.c b/Documentation/bl= ackfin/gptimers-example.c deleted file mode 100644 index 283eba9..0000000 --- a/Documentation/blackfin/gptimers-example.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Simple gptimers example - * http://docs.blackfin.uclinux.org/doku.php?id=3Dlinux-kernel:drivers:g= ptimers - * - * Copyright 2007-2009 Analog Devices Inc. - * - * Licensed under the GPL-2 or later. - */ - -#include -#include - -#include -#include - -/* ... random driver includes ... */ - -#define DRIVER_NAME "gptimer_example" - -#ifdef IRQ_TIMER5 -#define SAMPLE_IRQ_TIMER IRQ_TIMER5 -#else -#define SAMPLE_IRQ_TIMER IRQ_TIMER2 -#endif - -struct gptimer_data { - uint32_t period, width; -}; -static struct gptimer_data data; - -/* ... random driver state ... */ - -static irqreturn_t gptimer_example_irq(int irq, void *dev_id) -{ - struct gptimer_data *data =3D dev_id; - - /* make sure it was our timer which caused the interrupt */ - if (!get_gptimer_intr(TIMER5_id)) - return IRQ_NONE; - - /* read the width/period values that were captured for the waveform */ - data->width =3D get_gptimer_pwidth(TIMER5_id); - data->period =3D get_gptimer_period(TIMER5_id); - - /* acknowledge the interrupt */ - clear_gptimer_intr(TIMER5_id); - - /* tell the upper layers we took care of things */ - return IRQ_HANDLED; -} - -/* ... random driver code ... */ - -static int __init gptimer_example_init(void) -{ - int ret; - - /* grab the peripheral pins */ - ret =3D peripheral_request(P_TMR5, DRIVER_NAME); - if (ret) { - printk(KERN_NOTICE DRIVER_NAME ": peripheral request failed\n"); - return ret; - } - - /* grab the IRQ for the timer */ - ret =3D request_irq(SAMPLE_IRQ_TIMER, gptimer_example_irq, - IRQF_SHARED, DRIVER_NAME, &data); - if (ret) { - printk(KERN_NOTICE DRIVER_NAME ": IRQ request failed\n"); - peripheral_free(P_TMR5); - return ret; - } - - /* setup the timer and enable it */ - set_gptimer_config(TIMER5_id, - WDTH_CAP | PULSE_HI | PERIOD_CNT | IRQ_ENA); - enable_gptimers(TIMER5bit); - - return 0; -} -module_init(gptimer_example_init); - -static void __exit gptimer_example_exit(void) -{ - disable_gptimers(TIMER5bit); - free_irq(SAMPLE_IRQ_TIMER, &data); - peripheral_free(P_TMR5); -} -module_exit(gptimer_example_exit); - -MODULE_LICENSE("BSD"); diff --git a/Documentation/filesystems/.gitignore b/Documentation/filesys= tems/.gitignore deleted file mode 100644 index 31d6e42..0000000 --- a/Documentation/filesystems/.gitignore +++ /dev/null @@ -1 +0,0 @@ -dnotify_test diff --git a/Documentation/filesystems/00-INDEX b/Documentation/filesyste= ms/00-INDEX index 9922939..f66e748 100644 --- a/Documentation/filesystems/00-INDEX +++ b/Documentation/filesystems/00-INDEX @@ -2,8 +2,6 @@ - this file (info on some of the filesystems supported by linux). Locking - info on locking rules as they pertain to Linux VFS. -Makefile - - Makefile for building the filsystems-part of DocBook. 9p.txt - 9p (v9fs) is an implementation of the Plan 9 remote fs protocol. adfs.txt diff --git a/Documentation/filesystems/Makefile b/Documentation/filesyste= ms/Makefile deleted file mode 100644 index 883010c..0000000 --- a/Documentation/filesystems/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# List of programs to build -hostprogs-y :=3D dnotify_test - -# Tell kbuild to always build the programs -always :=3D $(hostprogs-y) diff --git a/Documentation/filesystems/dnotify_test.c b/Documentation/fil= esystems/dnotify_test.c deleted file mode 100644 index 8b37b4a..0000000 --- a/Documentation/filesystems/dnotify_test.c +++ /dev/null @@ -1,34 +0,0 @@ -#define _GNU_SOURCE /* needed to get the defines */ -#include /* in glibc 2.2 this has the needed - values defined */ -#include -#include -#include - -static volatile int event_fd; - -static void handler(int sig, siginfo_t *si, void *data) -{ - event_fd =3D si->si_fd; -} - -int main(void) -{ - struct sigaction act; - int fd; - - act.sa_sigaction =3D handler; - sigemptyset(&act.sa_mask); - act.sa_flags =3D SA_SIGINFO; - sigaction(SIGRTMIN + 1, &act, NULL); - - fd =3D open(".", O_RDONLY); - fcntl(fd, F_SETSIG, SIGRTMIN + 1); - fcntl(fd, F_NOTIFY, DN_MODIFY|DN_CREATE|DN_MULTISHOT); - /* we will now be notified if any of the files - in "." is modified or new files are created */ - while (1) { - pause(); - printf("Got event on fd=3D%d\n", event_fd); - } -} diff --git a/Documentation/ia64/.gitignore b/Documentation/ia64/.gitignor= e deleted file mode 100644 index ab806ed..0000000 --- a/Documentation/ia64/.gitignore +++ /dev/null @@ -1 +0,0 @@ -aliasing-test diff --git a/Documentation/ia64/Makefile b/Documentation/ia64/Makefile deleted file mode 100644 index d493163..0000000 --- a/Documentation/ia64/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# List of programs to build -hostprogs-y :=3D aliasing-test - -# Tell kbuild to always build the programs -always :=3D $(hostprogs-y) diff --git a/Documentation/ia64/aliasing-test.c b/Documentation/ia64/alia= sing-test.c deleted file mode 100644 index 62a190d..0000000 --- a/Documentation/ia64/aliasing-test.c +++ /dev/null @@ -1,263 +0,0 @@ -/* - * Exercise /dev/mem mmap cases that have been troublesome in the past - * - * (c) Copyright 2007 Hewlett-Packard Development Company, L.P. - * Bjorn Helgaas - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -int sum; - -static int map_mem(char *path, off_t offset, size_t length, int touch) -{ - int fd, rc; - void *addr; - int *c; - - fd =3D open(path, O_RDWR); - if (fd =3D=3D -1) { - perror(path); - return -1; - } - - if (fnmatch("/proc/bus/pci/*", path, 0) =3D=3D 0) { - rc =3D ioctl(fd, PCIIOC_MMAP_IS_MEM); - if (rc =3D=3D -1) - perror("PCIIOC_MMAP_IS_MEM ioctl"); - } - - addr =3D mmap(NULL, length, PROT_READ|PROT_WRITE, MAP_SHARED, fd, offse= t); - if (addr =3D=3D MAP_FAILED) - return 1; - - if (touch) { - c =3D (int *) addr; - while (c < (int *) (addr + length)) - sum +=3D *c++; - } - - rc =3D munmap(addr, length); - if (rc =3D=3D -1) { - perror("munmap"); - return -1; - } - - close(fd); - return 0; -} - -static int scan_tree(char *path, char *file, off_t offset, size_t length= , int touch) -{ - struct dirent **namelist; - char *name, *path2; - int i, n, r, rc =3D 0, result =3D 0; - struct stat buf; - - n =3D scandir(path, &namelist, 0, alphasort); - if (n < 0) { - perror("scandir"); - return -1; - } - - for (i =3D 0; i < n; i++) { - name =3D namelist[i]->d_name; - - if (fnmatch(".", name, 0) =3D=3D 0) - goto skip; - if (fnmatch("..", name, 0) =3D=3D 0) - goto skip; - - path2 =3D malloc(strlen(path) + strlen(name) + 3); - strcpy(path2, path); - strcat(path2, "/"); - strcat(path2, name); - - if (fnmatch(file, name, 0) =3D=3D 0) { - rc =3D map_mem(path2, offset, length, touch); - if (rc =3D=3D 0) - fprintf(stderr, "PASS: %s 0x%lx-0x%lx is %s\n", path2, offset, offse= t + length, touch ? "readable" : "mappable"); - else if (rc > 0) - fprintf(stderr, "PASS: %s 0x%lx-0x%lx not mappable\n", path2, offset= , offset + length); - else { - fprintf(stderr, "FAIL: %s 0x%lx-0x%lx not accessible\n", path2, offs= et, offset + length); - return rc; - } - } else { - r =3D lstat(path2, &buf); - if (r =3D=3D 0 && S_ISDIR(buf.st_mode)) { - rc =3D scan_tree(path2, file, offset, length, touch); - if (rc < 0) - return rc; - } - } - - result |=3D rc; - free(path2); - -skip: - free(namelist[i]); - } - free(namelist); - return result; -} - -char buf[1024]; - -static int read_rom(char *path) -{ - int fd, rc; - size_t size =3D 0; - - fd =3D open(path, O_RDWR); - if (fd =3D=3D -1) { - perror(path); - return -1; - } - - rc =3D write(fd, "1", 2); - if (rc <=3D 0) { - close(fd); - perror("write"); - return -1; - } - - do { - rc =3D read(fd, buf, sizeof(buf)); - if (rc > 0) - size +=3D rc; - } while (rc > 0); - - close(fd); - return size; -} - -static int scan_rom(char *path, char *file) -{ - struct dirent **namelist; - char *name, *path2; - int i, n, r, rc =3D 0, result =3D 0; - struct stat buf; - - n =3D scandir(path, &namelist, 0, alphasort); - if (n < 0) { - perror("scandir"); - return -1; - } - - for (i =3D 0; i < n; i++) { - name =3D namelist[i]->d_name; - - if (fnmatch(".", name, 0) =3D=3D 0) - goto skip; - if (fnmatch("..", name, 0) =3D=3D 0) - goto skip; - - path2 =3D malloc(strlen(path) + strlen(name) + 3); - strcpy(path2, path); - strcat(path2, "/"); - strcat(path2, name); - - if (fnmatch(file, name, 0) =3D=3D 0) { - rc =3D read_rom(path2); - - /* - * It's OK if the ROM is unreadable. Maybe there - * is no ROM, or some other error occurred. The - * important thing is that no MCA happened. - */ - if (rc > 0) - fprintf(stderr, "PASS: %s read %d bytes\n", path2, rc); - else { - fprintf(stderr, "PASS: %s not readable\n", path2); - return rc; - } - } else { - r =3D lstat(path2, &buf); - if (r =3D=3D 0 && S_ISDIR(buf.st_mode)) { - rc =3D scan_rom(path2, file); - if (rc < 0) - return rc; - } - } - - result |=3D rc; - free(path2); - -skip: - free(namelist[i]); - } - free(namelist); - return result; -} - -int main(void) -{ - int rc; - - if (map_mem("/dev/mem", 0, 0xA0000, 1) =3D=3D 0) - fprintf(stderr, "PASS: /dev/mem 0x0-0xa0000 is readable\n"); - else - fprintf(stderr, "FAIL: /dev/mem 0x0-0xa0000 not accessible\n"); - - /* - * It's not safe to blindly read the VGA frame buffer. If you know - * how to poke the card the right way, it should respond, but it's - * not safe in general. Many machines, e.g., Intel chipsets, cover - * up a non-responding card by just returning -1, but others will - * report the failure as a machine check. - */ - if (map_mem("/dev/mem", 0xA0000, 0x20000, 0) =3D=3D 0) - fprintf(stderr, "PASS: /dev/mem 0xa0000-0xc0000 is mappable\n"); - else - fprintf(stderr, "FAIL: /dev/mem 0xa0000-0xc0000 not accessible\n"); - - if (map_mem("/dev/mem", 0xC0000, 0x40000, 1) =3D=3D 0) - fprintf(stderr, "PASS: /dev/mem 0xc0000-0x100000 is readable\n"); - else - fprintf(stderr, "FAIL: /dev/mem 0xc0000-0x100000 not accessible\n"); - - /* - * Often you can map all the individual pieces above (0-0xA0000, - * 0xA0000-0xC0000, and 0xC0000-0x100000), but can't map the whole - * thing at once. This is because the individual pieces use different - * attributes, and there's no single attribute supported over the - * whole region. - */ - rc =3D map_mem("/dev/mem", 0, 1024*1024, 0); - if (rc =3D=3D 0) - fprintf(stderr, "PASS: /dev/mem 0x0-0x100000 is mappable\n"); - else if (rc > 0) - fprintf(stderr, "PASS: /dev/mem 0x0-0x100000 not mappable\n"); - else - fprintf(stderr, "FAIL: /dev/mem 0x0-0x100000 not accessible\n"); - - scan_tree("/sys/class/pci_bus", "legacy_mem", 0, 0xA0000, 1); - scan_tree("/sys/class/pci_bus", "legacy_mem", 0xA0000, 0x20000, 0); - scan_tree("/sys/class/pci_bus", "legacy_mem", 0xC0000, 0x40000, 1); - scan_tree("/sys/class/pci_bus", "legacy_mem", 0, 1024*1024, 0); - - scan_rom("/sys/devices", "rom"); - - scan_tree("/proc/bus/pci", "??.?", 0, 0xA0000, 1); - scan_tree("/proc/bus/pci", "??.?", 0xA0000, 0x20000, 0); - scan_tree("/proc/bus/pci", "??.?", 0xC0000, 0x40000, 1); - scan_tree("/proc/bus/pci", "??.?", 0, 1024*1024, 0); - - return rc; -} diff --git a/Documentation/kselftest.txt b/Documentation/kselftest.txt index 979eaca..54bee77 100644 --- a/Documentation/kselftest.txt +++ b/Documentation/kselftest.txt @@ -1,8 +1,9 @@ Linux Kernel Selftests =20 The kernel contains a set of "self tests" under the tools/testing/selfte= sts/ -directory. These are intended to be small unit tests to exercise individ= ual -code paths in the kernel. +directory. These are intended to be small tests to exercise individual c= ode +paths in the kernel. Tests are intended to be run after building, instal= ling +and booting a kernel. =20 On some systems, hot-plug tests could hang forever waiting for cpu and memory to be ready to be offlined. A special hot-plug target is created diff --git a/Documentation/laptops/.gitignore b/Documentation/laptops/.gi= tignore deleted file mode 100644 index 9fc984e..0000000 --- a/Documentation/laptops/.gitignore +++ /dev/null @@ -1 +0,0 @@ -dslm diff --git a/Documentation/laptops/00-INDEX b/Documentation/laptops/00-IN= DEX index 7c0ac2a..86169dc 100644 --- a/Documentation/laptops/00-INDEX +++ b/Documentation/laptops/00-INDEX @@ -1,13 +1,9 @@ 00-INDEX - This file -Makefile - - Makefile for building dslm example program. asus-laptop.txt - information on the Asus Laptop Extras driver. disk-shock-protection.txt - information on hard disk shock protection. -dslm.c - - Simple Disk Sleep Monitor program laptop-mode.txt - how to conserve battery power using laptop-mode. sony-laptop.txt diff --git a/Documentation/laptops/Makefile b/Documentation/laptops/Makef= ile deleted file mode 100644 index 0abe44f..0000000 --- a/Documentation/laptops/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# List of programs to build -hostprogs-y :=3D dslm - -# Tell kbuild to always build the programs -always :=3D $(hostprogs-y) diff --git a/Documentation/laptops/dslm.c b/Documentation/laptops/dslm.c deleted file mode 100644 index d5dd2d4..0000000 --- a/Documentation/laptops/dslm.c +++ /dev/null @@ -1,166 +0,0 @@ -/* - * dslm.c - * Simple Disk Sleep Monitor - * by Bartek Kania - * Licensed under the GPL - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef DEBUG -#define D(x) x -#else -#define D(x) -#endif - -int endit =3D 0; - -/* Check if the disk is in powersave-mode - * Most of the code is stolen from hdparm. - * 1 =3D active, 0 =3D standby/sleep, -1 =3D unknown */ -static int check_powermode(int fd) -{ - unsigned char args[4] =3D {WIN_CHECKPOWERMODE1,0,0,0}; - int state; - - if (ioctl(fd, HDIO_DRIVE_CMD, &args) - && (args[0] =3D WIN_CHECKPOWERMODE2) /* try again with 0x98 */ - && ioctl(fd, HDIO_DRIVE_CMD, &args)) { - if (errno !=3D EIO || args[0] !=3D 0 || args[1] !=3D 0) { - state =3D -1; /* "unknown"; */ - } else - state =3D 0; /* "sleeping"; */ - } else { - state =3D (args[2] =3D=3D 255) ? 1 : 0; - } - D(printf(" drive state is: %d\n", state)); - - return state; -} - -static char *state_name(int i) -{ - if (i =3D=3D -1) return "unknown"; - if (i =3D=3D 0) return "sleeping"; - if (i =3D=3D 1) return "active"; - - return "internal error"; -} - -static char *myctime(time_t time) -{ - char *ts =3D ctime(&time); - ts[strlen(ts) - 1] =3D 0; - - return ts; -} - -static void measure(int fd) -{ - time_t start_time; - int last_state; - time_t last_time; - int curr_state; - time_t curr_time =3D 0; - time_t time_diff; - time_t active_time =3D 0; - time_t sleep_time =3D 0; - time_t unknown_time =3D 0; - time_t total_time =3D 0; - int changes =3D 0; - float tmp; - - printf("Starting measurements\n"); - - last_state =3D check_powermode(fd); - start_time =3D last_time =3D time(0); - printf(" System is in state %s\n\n", state_name(last_state)); - - while(!endit) { - sleep(1); - curr_state =3D check_powermode(fd); - - if (curr_state !=3D last_state || endit) { - changes++; - curr_time =3D time(0); - time_diff =3D curr_time - last_time; - - if (last_state =3D=3D 1) active_time +=3D time_diff; - else if (last_state =3D=3D 0) sleep_time +=3D time_diff; - else unknown_time +=3D time_diff; - - last_state =3D curr_state; - last_time =3D curr_time; - - printf("%s: State-change to %s\n", myctime(curr_time), - state_name(curr_state)); - } - } - changes--; /* Compensate for SIGINT */ - - total_time =3D time(0) - start_time; - printf("\nTotal running time: %lus\n", curr_time - start_time); - printf(" State changed %d times\n", changes); - - tmp =3D (float)sleep_time / (float)total_time * 100; - printf(" Time in sleep state: %lus (%.2f%%)\n", sleep_time, tmp); - tmp =3D (float)active_time / (float)total_time * 100; - printf(" Time in active state: %lus (%.2f%%)\n", active_time, tmp);= - tmp =3D (float)unknown_time / (float)total_time * 100; - printf(" Time in unknown state: %lus (%.2f%%)\n", unknown_time, tmp)= ; -} - -static void ender(int s) -{ - endit =3D 1; -} - -static void usage(void) -{ - puts("usage: dslm [-w