Send commitlog mailing list submissions to
        commitlog@lists.openmoko.org

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.openmoko.org/mailman/listinfo/commitlog
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of commitlog digest..."
Today's Topics:

   1. r4706 - trunk/src/target/debug/input ([EMAIL PROTECTED])
   2. r4707 - trunk/src/host/devirginator ([EMAIL PROTECTED])
   3. r4708 - trunk/src/host/devirginator ([EMAIL PROTECTED])
   4. development tree for U-Boot: Changes to 'stable'
      ([EMAIL PROTECTED])
   5. development tree for U-Boot: Changes to 'stable'
      ([EMAIL PROTECTED])
   6. development tree for U-Boot: Changes to 'stable'
      ([EMAIL PROTECTED])
   7. r4709 - in trunk/src/target: . input-filter
      ([EMAIL PROTECTED])
   8. r4710 - trunk/src/target/input-filter ([EMAIL PROTECTED])
--- Begin Message ---
Author: laforge
Date: 2008-10-09 12:32:38 +0200 (Thu, 09 Oct 2008)
New Revision: 4706

Added:
   trunk/src/target/debug/input/input-stat.c
Log:
add input event rate statistics program


Added: trunk/src/target/debug/input/input-stat.c
===================================================================
--- trunk/src/target/debug/input/input-stat.c                           (rev 0)
+++ trunk/src/target/debug/input/input-stat.c   2008-10-09 10:32:38 UTC (rev 
4706)
@@ -0,0 +1,105 @@
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <signal.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/fcntl.h>
+
+#include <linux/input.h>
+
+#define READBUF_SIZE (1024*sizeof(struct input_event))
+
+struct stats {
+       unsigned int num_reads;
+       unsigned int num_events;
+       struct timeval tv_first;
+       struct timeval tv_last;
+};
+
+static struct stats st;
+static char *filename;
+
+static int handle_event(struct input_event *evt)
+{
+       if (st.num_events == 1)
+               memcpy(&st.tv_first, &evt->time, sizeof(st.tv_first));
+
+       memcpy(&st.tv_last, &evt->time, sizeof(st.tv_last));
+
+       return 0;
+}
+
+static void time_difference(const struct timeval *start,
+                           struct timeval *end,
+                           struct timeval *result)
+{
+       if (end->tv_usec < start->tv_usec) {
+               end->tv_usec += 1000000;
+               end->tv_sec -= 1;
+       }
+
+       result->tv_usec = end->tv_usec - start->tv_usec;
+       result->tv_sec = end->tv_sec - start->tv_sec;
+}
+
+static void print_stats(void)
+{
+       struct timeval tv;
+
+       time_difference(&st.tv_first, &st.tv_last, &tv);
+
+       printf("input statiststics for device %s:\n", filename);
+       printf("\t%u reads, %u events in %u.%u seconds\n",
+               st.num_reads, st.num_events, tv.tv_sec, tv.tv_usec);
+       printf("\t%u events/read, %u events/second\n",
+               st.num_events / st.num_reads,
+               st.num_events / tv.tv_sec);
+}
+
+void sighand(int signal)
+{
+       fprintf(stderr, "received signal %d\n", signal);
+       print_stats();
+       exit(0);
+}
+
+int main(int argc, char **argv)
+{
+       int fd;
+       char buf[READBUF_SIZE];
+
+       if (argc < 2)
+               exit(2);
+
+       filename = argv[1];
+
+       fd = open(filename, O_RDONLY);
+       if (fd < 0) {
+               perror("open");
+               exit(1);
+       }
+
+       signal(SIGHUP, &sighand);
+       signal(SIGINT, &sighand);
+       signal(SIGTERM, &sighand);
+
+       while (1) {
+               int rc, i;
+               struct input_event *evt;
+
+               rc = read(fd, buf, sizeof(buf));
+               if (rc < 0) {
+                       perror("read");
+                       break;
+               }
+               st.num_reads++;
+
+               for (i = 0; i < rc; i += sizeof(struct input_event)) {
+                       evt = (struct input_event *) (buf + i);
+                       st.num_events++;
+                       handle_event(evt);
+               }
+       }
+}




--- End Message ---
--- Begin Message ---
Author: zecke
Date: 2008-10-09 12:41:15 +0200 (Thu, 09 Oct 2008)
New Revision: 4707

Modified:
   trunk/src/host/devirginator/config.gta02v5
Log:
[devirginator] Fix the config.gta02v5
    - Get the bootloader and low level foo from the daily build
    - Kernel and rootfs from the release


Modified: trunk/src/host/devirginator/config.gta02v5
===================================================================
--- trunk/src/host/devirginator/config.gta02v5  2008-10-09 10:32:38 UTC (rev 
4706)
+++ trunk/src/host/devirginator/config.gta02v5  2008-10-09 10:41:15 UTC (rev 
4707)
@@ -7,14 +7,15 @@
 OPENOCD_HOST=localhost
 PLATFORM=gta02
 BOARD=v5
+RELEASE=Om2008.9
 
-stuff=http://buildhost.openmoko.org/daily/neo1973/deploy/glibc/images/neo1973/
+stuff=http://downloads.openmoko.org
 
-LOWLEVEL=$stuff/lowlevel-foo-$PLATFORM$BOARD-latest.bin
-UBOOT=$stuff/uboot-$PLATFORM$BOARD-latest.bin
-UIMAGE=$stuff/uImage-om-$PLATFORM-latest.bin
-ROOTFS=$stuff/openmoko-devel-image-om-$PLATFORM.jffs2
+LOWLEVEL=$stuff/daily/${PLATFORM}${BOARD}_and_up-lowlevel.bin
+UBOOT=$stuff/daily/${PLATFORM}${BOARD}_and_up-u-boot.bin
+UIMAGE=$stuff/releases/$RELEASE/$RELEASE.uImage.bin
+ROOTFS=$stuff/releases/$RELEASE/$RELEASE.rootfs.jffs2
 
-DFU_UTIL=$stuff/dfu-util
+DFU_UTIL=$stuff/daily/dfu-util
 #OPENOCD=$stuff/openocd
 OPENOCD_CFG=http://people.openmoko.org/werner/openocd.cfg




--- End Message ---
--- Begin Message ---
Author: zecke
Date: 2008-10-09 13:01:40 +0200 (Thu, 09 Oct 2008)
New Revision: 4708

Modified:
   trunk/src/host/devirginator/config.gta01bv4
Log:
[devirginator] Upgrade config.gta01bv4
    - u-boot and lowlevel are the proper versions
    - kernel and rootfs are unlikely to work... this is an ongoing challenge


Modified: trunk/src/host/devirginator/config.gta01bv4
===================================================================
--- trunk/src/host/devirginator/config.gta01bv4 2008-10-09 10:41:15 UTC (rev 
4707)
+++ trunk/src/host/devirginator/config.gta01bv4 2008-10-09 11:01:40 UTC (rev 
4708)
@@ -7,14 +7,15 @@
 OPENOCD_HOST=localhost
 PLATFORM=gta01
 BOARD=bv4
+RELEASE=Om2008.9
 
-stuff=http://buildhost.openmoko.org/daily/neo1973/deploy/glibc/images/neo1973/
+stuff=http://downloads.openmoko.org
 
-LOWLEVEL=$stuff/lowlevel-foo-$PLATFORM$BOARD-latest.bin
-UBOOT=$stuff/uboot-$PLATFORM$BOARD-latest.bin
-UIMAGE=$stuff/uImage-neo1973-latest.bin
-ROOTFS=$stuff/openmoko-devel-image-fic-$PLATFORM.jffs2
+LOWLEVEL=$stuff/daily/${PLATFORM}${BOARD}-lowlevel.bin
+UBOOT=$stuff/daily/${PLATFORM}${BOARD}-u-boot.bin
+UIMAGE=$stuff/releases/$RELEASE/$RELEASE.uImage.bin
+ROOTFS=$stuff/releases/$RELEASE/$RELEASE.rootfs.jffs2
 
-DFU_UTIL=$stuff/dfu-util
+DFU_UTIL=$stuff/daily/dfu-util
 #OPENOCD=$stuff/openocd
 OPENOCD_CFG=http://people.openmoko.org/werner/openocd.cfg




--- End Message ---
--- Begin Message ---
 board/neo1973/gta02/gta02.c |   92 ++++++++++++++++++++++++++++++-------------
 1 files changed, 64 insertions(+), 28 deletions(-)

New commits:
commit 69f7dbbbf62c2fe649018979c803c415e6c566e7
Author: Andy Green <[EMAIL PROTECTED]>
Date:   Thu Oct 9 16:35:28 2008 +0100

    u-boot-clean-batt-charge-patch.patch
    
    Signed-off-by: Andy Green <[EMAIL PROTECTED]>

commit fe809118262bc6ee4e6f3292927841a4190f251a
Author: Andy Green <[EMAIL PROTECTED]>
Date:   Thu Oct 9 15:39:19 2008 +0100




--- End Message ---
--- Begin Message ---
Rebased ref, commits from common ancestor:
commit d9daa95bffa9bcfecf49a53e5ebd5e2de6ed058d
Author: Philipp Hug <[EMAIL PROTECTED]>
Date:   Thu Oct 9 16:57:31 2008 +0100

    Fixes for U-Boot charging




--- End Message ---
--- Begin Message ---
 board/neo1973/gta02/gta02.c |   27 ++++++++++++---------------
 1 files changed, 12 insertions(+), 15 deletions(-)

New commits:
commit b2f00e29ad2c499491292856c60e5115edbbef44
Author: Andy Green <[EMAIL PROTECTED]>
Date:   Thu Oct 9 16:57:49 2008 +0100

    u-boot-clean-batt-charge-patch.patch
    
    Signed-off-by: Andy Green <[EMAIL PROTECTED]>




--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2008-10-10 01:16:20 +0200 (Fri, 10 Oct 2008)
New Revision: 4709

Added:
   trunk/src/target/input-filter/
   trunk/src/target/input-filter/input-filter.c
Log:
Add a small (written in C) helper program that filters /dev/input/event
file and removes all ABS and REL type events from the event stream.

This is to be used as a quick fix to solve performance problems with
current FSO related to FSO processing each and every individual ABS_X/ABS_Y
event from s3c2410_ts


Added: trunk/src/target/input-filter/input-filter.c
===================================================================
--- trunk/src/target/input-filter/input-filter.c                                
(rev 0)
+++ trunk/src/target/input-filter/input-filter.c        2008-10-09 23:16:20 UTC 
(rev 4709)
@@ -0,0 +1,188 @@
+/* /dev/input/event filtering tool
+ *
+ * (C) 2008 by Harald Welte <[EMAIL PROTECTED]>
+ * All Rights Reserved
+ *
+ * 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; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */ 
+
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <signal.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/fcntl.h>
+
+#include <linux/input.h>
+
+#define READBUF_SIZE (1024*sizeof(struct input_event))
+
+struct stats {
+       unsigned int num_reads;
+       unsigned int num_events_in;
+       unsigned int num_events_out;
+       struct timeval tv_first;
+       struct timeval tv_last;
+};
+
+static struct stats st;
+static char *indev_filename;
+static char *out_filename;
+static int outfd;
+
+static int handle_event(struct input_event *evt)
+{
+       int rc;
+
+       /* statistics */
+       st.num_events_in++;
+       if (st.num_events_in == 1)
+               memcpy(&st.tv_first, &evt->time, sizeof(st.tv_first));
+       memcpy(&st.tv_last, &evt->time, sizeof(st.tv_last));
+
+       switch (evt->type) {
+               /* supress any absolute or relative movement events */
+               case EV_ABS:
+               case EV_REL:
+                       return sizeof(*evt);
+               default:
+                       break;
+       }
+
+       rc = write(outfd, evt, sizeof(*evt));
+       st.num_events_out++;
+
+       return rc;
+}
+
+static void time_difference(const struct timeval *start,
+                           struct timeval *end,
+                           struct timeval *result)
+{
+       if (end->tv_usec < start->tv_usec) {
+               end->tv_usec += 1000000;
+               end->tv_sec -= 1;
+       }
+
+       result->tv_usec = end->tv_usec - start->tv_usec;
+       result->tv_sec = end->tv_sec - start->tv_sec;
+}
+
+static void reset_stats(void)
+{
+       memset(&st, 0, sizeof(st));
+}
+
+static void print_stats(void)
+{
+       struct timeval tv;
+
+       time_difference(&st.tv_first, &st.tv_last, &tv);
+
+       printf("input statiststics for device %s:\n", indev_filename);
+       printf("\t%u reads, %u events in, %u events out, %u.%u seconds\n",
+               st.num_reads, st.num_events_in, st.num_events_out,
+               tv.tv_sec, tv.tv_usec);
+       printf("\t%u events/read, %u events/second in, %u events/secound out\n",
+               st.num_events_in / st.num_reads,
+               st.num_events_in / tv.tv_sec, st.num_events_out / tv.tv_sec);
+}
+
+void sighand(int signal)
+{
+       fprintf(stderr, "received signal %d\n", signal);
+       print_stats();
+
+       switch (signal) {
+       case SIGHUP:
+               break;
+       case SIGUSR1:
+               reset_stats();
+       case SIGINT:
+       case SIGTERM:
+               exit(0);
+               break;
+       }
+}
+
+int main(int argc, char **argv)
+{
+       int infd;
+       char buf[READBUF_SIZE];
+
+       if (argc != 3) {
+               fprintf(stderr, "this program needs two single arguments: "
+                       "the /dev/input/eventX device you want to open, "
+                       "and the name of the FIFO to be used for output\n");
+               exit(2);
+       }
+
+       indev_filename = argv[1];
+       out_filename = argv[2];
+
+       infd = open(indev_filename, O_RDONLY);
+       if (infd < 0) {
+               perror("open input");
+               exit(1);
+       }
+
+       outfd = open(out_filename, O_WRONLY);
+       if (outfd < 0) {
+               perror("open output");
+               close (infd);
+               exit(1);
+       }
+
+       signal(SIGHUP, &sighand);
+       signal(SIGINT, &sighand);
+       signal(SIGTERM, &sighand);
+       signal(SIGUSR1, &sighand);
+       signal(SIGPIPE, SIG_IGN);
+
+       while (1) {
+               int rc, i;
+               struct input_event *evt;
+
+               rc = read(infd, buf, sizeof(buf));
+               if (rc < 0) {
+                       perror("read");
+                       break;
+               }
+               st.num_reads++;
+
+               for (i = 0; i < rc; i += sizeof(struct input_event)) {
+                       evt = (struct input_event *) (buf + i);
+                       rc = handle_event(evt);
+                       if (rc < 0) {
+                               perror("handle_event");
+                               exit(3);
+                       }
+                       if (rc < sizeof(struct input_event)) {
+                               fprintf(stderr, "short write\n");
+                               close(outfd);
+                               /* we do a blocking reopen */
+                               outfd = open(out_filename, O_WRONLY);
+                               if (outfd < 0) {
+                                       perror("reopen output");
+                                       close (infd);
+                                       exit(4);
+                               }
+                       }
+               }
+       }
+}




--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2008-10-10 01:35:22 +0200 (Fri, 10 Oct 2008)
New Revision: 4710

Added:
   trunk/src/target/input-filter/README
Log:
add README for input-filter


Added: trunk/src/target/input-filter/README
===================================================================
--- trunk/src/target/input-filter/README                                (rev 0)
+++ trunk/src/target/input-filter/README        2008-10-09 23:35:22 UTC (rev 
4710)
@@ -0,0 +1,66 @@
+From [EMAIL PROTECTED] Fri Oct 10 01:34:22 2008
+Date: Fri, 10 Oct 2008 01:34:22 +0200
+From: Harald Welte <[EMAIL PROTECTED]>
+To: [EMAIL PROTECTED]
+Cc: Thomas Seiler <[EMAIL PROTECTED]>,
+       Michael Lauer <[EMAIL PROTECTED]>,
+       Carsten Haitzler <[EMAIL PROTECTED]>
+Subject: Re: frameworkd: performance problems in /dev/input handling
+
+Hi!
+
+I've been thinking about this problem for quite some time and haven't
+really come up with any satisfactory solution that would give quick results
+without introducing big kludges into either the kernel or frameworkd.
+
+However, when I used my input-stat tool to get some statistics on how
+much events the touchscreen driver issues to userspace, I noticed that
+this C program was never consuming more than 0.1% CPU while dropping all
+incoming events.
+
+This lead to the idea to implement a small filter program in C, called
+input-filter.  It is available from
+http://svn.openmoko.org/trunk/src/target/input-filter/
+
+What it does:
+
+* read input_events from the input device (first argument)
+* remove all ABS_* and REL_* events from the stream
+* pass on all other events to the FIFO (named pipe) that is
+  specified as second argument
+* create some nice statistics that are printed to stdout if
+  you send a SIGHUP and get reset if you send SIGUSR1
+
+How to use:
+
+1) create fifo and start input-filter
+
+# mkfifo /dev/input/event5
+# input-filter /dev/input/event1 /dev/input/event5
+
+2) ensure that odeviced.input and odeviced.idlenotifier ignore input
+   device '1' (ignoreinput=1,2,3) instead of only 2,3
+
+3) ensure that odeviced.input ignores input also ignores input device
+   '5'.  This is neccessarry, since you cannot have two readers on the
+   same FIFO.  This is a hack, but to the best of my knowledge, touchscreen
+   related events are not important for odeviced.input for the time being.
+
+4) start frameworkd as usual
+
+Results:
+
+Touching the touchscreen and keeping it touched now makes frameworkd to go to
+0-2% CPU usage (98% without input filter).  
+
+This solves the problem that currently any UI app will get starved of CPU
+cycles if you try to use scrollbars or drag+drop like functionality.
+
+I know it's not nice, but still the least invasive solution that I could come
+up with.  Maybe you could consider merging it until a better solution is found.
+
+Cheers,
+-- 
+- Harald Welte <[EMAIL PROTECTED]>                     http://openmoko.org/
+============================================================================
+Software for the world's first truly open Free Software mobile phone




--- End Message ---
_______________________________________________
commitlog mailing list
commitlog@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/commitlog

Reply via email to