Modified arch/x86/configs/i386_defconfig for logger feature.
authorkt920.kim <kt920.kim@samsung.com>
Wed, 11 May 2011 03:11:29 +0000 (12:11 +0900)
committerkt920.kim <kt920.kim@samsung.com>
Wed, 11 May 2011 03:11:29 +0000 (12:11 +0900)
Added CONFIG_ANDROID_LOGGER symbol and modified drivers/staging/android/Kconfig to support android driver.
Defined LOGGER_LOG_SYSTEM macro for system and framework messages.
Changed size of LOGGER_LOG_MAIN and LOGGER_LOG_RADIO from 64*1024 to 128*1024.

arch/x86/configs/i386_defconfig
drivers/staging/android/Kconfig
drivers/staging/android/binder.c
drivers/staging/android/logger.c
drivers/staging/android/logger.h

index c211d07cda529d207977f6af49978633dcae4817..ca55f28b7cf97b692fe22817d529b9853afe00a1 100644 (file)
@@ -2108,6 +2108,7 @@ CONFIG_EEEPC_LAPTOP=y
 # CONFIG_ACPI_WMI is not set
 # CONFIG_ACPI_ASUS is not set
 # CONFIG_ACPI_TOSHIBA is not set
+CONFIG_ANDROID_LOGGER=y
 
 #
 # Firmware Drivers
index eb675635ae60c532e800ae6a57c1c9c667b052b8..95bc43af89c5b06ec6d6f54f30f99fba9bf0ade2 100644 (file)
@@ -2,8 +2,7 @@ menu "Android"
 
 config ANDROID
        bool "Android Drivers"
-       depends on BROKEN
-       default N
+       default y 
        ---help---
          Enable support for various drivers needed on the Android platform
 
index 99010d4b3044b2c33c9d709e334b5be7871b9599..17e5c24eae162a5254a0cfae2925e8b7ea12c54c 100644 (file)
@@ -46,6 +46,7 @@ static struct proc_dir_entry *binder_proc_dir_entry_proc;
 static struct binder_node *binder_context_mgr_node;
 static uid_t binder_context_mgr_uid = -1;
 static int binder_last_id;
+static struct workqueue_struct *binder_deferred_workqueue;
 
 static int binder_read_proc_proc(char *page, char **start, off_t off,
                                 int count, int *eof, void *data);
@@ -3025,11 +3026,14 @@ static void binder_deferred_release(struct binder_proc *proc)
                int i;
                for (i = 0; i < proc->buffer_size / PAGE_SIZE; i++) {
                        if (proc->pages[i]) {
+                               void *page_addr = proc->buffer + i * PAGE_SIZE;
                                binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
                                             "binder_release: %d: "
                                             "page %d at %p not freed\n",
                                             proc->pid, i,
-                                            proc->buffer + i * PAGE_SIZE);
+                                            page_addr);
+                               unmap_kernel_range((unsigned long)page_addr,
+                                       PAGE_SIZE);
                                __free_page(proc->pages[i]);
                                page_count++;
                        }
@@ -3099,7 +3103,7 @@ binder_defer_work(struct binder_proc *proc, enum binder_deferred_state defer)
        if (hlist_unhashed(&proc->deferred_work_node)) {
                hlist_add_head(&proc->deferred_work_node,
                                &binder_deferred_list);
-               schedule_work(&binder_deferred_work);
+               queue_work(binder_deferred_workqueue, &binder_deferred_work);
        }
        mutex_unlock(&binder_deferred_lock);
 }
@@ -3727,6 +3731,10 @@ static int __init binder_init(void)
 {
        int ret;
 
+       binder_deferred_workqueue = create_singlethread_workqueue("binder");
+       if (!binder_deferred_workqueue)
+               return -ENOMEM;
+
        binder_proc_dir_entry_root = proc_mkdir("binder", NULL);
        if (binder_proc_dir_entry_root)
                binder_proc_dir_entry_proc = proc_mkdir("proc",
index 6c10b456c6cc5c082c6ceca278672c98538ff0aa..3b5a3606d8afbb0b79bfa63776c4d3eaf4f5bbc8 100644 (file)
@@ -17,6 +17,7 @@
  * GNU General Public License for more details.
  */
 
+#include <linux/sched.h>
 #include <linux/module.h>
 #include <linux/fs.h>
 #include <linux/miscdevice.h>
@@ -553,9 +554,10 @@ static struct logger_log VAR = { \
        .size = SIZE, \
 };
 
-DEFINE_LOGGER_DEVICE(log_main, LOGGER_LOG_MAIN, 64*1024)
+DEFINE_LOGGER_DEVICE(log_main, LOGGER_LOG_MAIN, 128*1024)
 DEFINE_LOGGER_DEVICE(log_events, LOGGER_LOG_EVENTS, 256*1024)
-DEFINE_LOGGER_DEVICE(log_radio, LOGGER_LOG_RADIO, 64*1024)
+DEFINE_LOGGER_DEVICE(log_radio, LOGGER_LOG_RADIO, 128*1024)
+DEFINE_LOGGER_DEVICE(log_system, LOGGER_LOG_SYSTEM, 128*1024)
 
 static struct logger_log *get_log_from_minor(int minor)
 {
@@ -565,6 +567,8 @@ static struct logger_log *get_log_from_minor(int minor)
                return &log_events;
        if (log_radio.misc.minor == minor)
                return &log_radio;
+       if (log_system.misc.minor == minor)
+               return &log_system;
        return NULL;
 }
 
@@ -601,6 +605,10 @@ static int __init logger_init(void)
        if (unlikely(ret))
                goto out;
 
+       ret = init_log(&log_system);
+       if (unlikely(ret))
+               goto out;
+
 out:
        return ret;
 }
index a562434d74190f015317e2571ccedb80d5139304..2cb06e9d8f9821ea6aa98b63d2a79b4e3b171578 100644 (file)
@@ -32,6 +32,7 @@ struct logger_entry {
 
 #define LOGGER_LOG_RADIO       "log_radio"     /* radio-related messages */
 #define LOGGER_LOG_EVENTS      "log_events"    /* system/hardware events */
+#define LOGGER_LOG_SYSTEM      "log_system"    /* system/framework messages */
 #define LOGGER_LOG_MAIN                "log_main"      /* everything else */
 
 #define LOGGER_ENTRY_MAX_LEN           (4*1024)