Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b0eaeb42 authored by Mark Salyzyn's avatar Mark Salyzyn Committed by Android Git Automerger
Browse files

am a69270db: Merge "liblog: enable logging to logd."

* commit 'a69270db':
  liblog: enable logging to logd.
parents a931cf07 a69270db
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -79,14 +79,10 @@ struct logger_entry_v3 {
struct log_msg {
    union {
        unsigned char buf[LOGGER_ENTRY_MAX_LEN + 1];
        struct logger_entry_v2 entry;
        struct logger_entry_v3 entry;
        struct logger_entry_v3 entry_v3;
        struct logger_entry_v2 entry_v2;
        struct logger_entry    entry_v1;
        struct {
            unsigned char buf[LOGGER_ENTRY_MAX_LEN + 1];
            log_id_t id;
        } extra;
    } __attribute__((aligned(4)));
#ifdef __cplusplus
    /* Matching log_time operators */
@@ -126,7 +122,7 @@ struct log_msg {
    /* packet methods */
    log_id_t id()
    {
        return extra.id;
        return (log_id_t) entry.lid;
    }
    char *msg()
    {
+10 −2
Original line number Diff line number Diff line
/*
 * Copyright (C) 2007 The Android Open Source Project
 * Copyright (C) 2007-2014 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -47,6 +47,8 @@
#include "util.h"
#include "log.h"

#define UNUSED __attribute__((__unused__))

#define SYSFS_PREFIX    "/sys"
#define FIRMWARE_DIR1   "/etc/firmware"
#define FIRMWARE_DIR2   "/vendor/firmware"
@@ -193,7 +195,7 @@ static mode_t get_device_perm(const char *path, unsigned *uid, unsigned *gid)
}

static void make_device(const char *path,
                        const char *upath,
                        const char *upath UNUSED,
                        int block, int major, int minor)
{
    unsigned uid;
@@ -589,6 +591,11 @@ static void mkdir_recursive_for_devpath(const char *devpath)
    mkdir_recursive(dir, 0755);
}

static inline void __attribute__((__deprecated__)) kernel_logger()
{
    INFO("kernel logger is deprecated\n");
}

static void handle_generic_device_event(struct uevent *uevent)
{
    char *base;
@@ -675,6 +682,7 @@ static void handle_generic_device_event(struct uevent *uevent)
         make_dir(base, 0755);
     } else if(!strncmp(uevent->subsystem, "misc", 4) &&
                 !strncmp(name, "log_", 4)) {
         kernel_logger();
         base = "/dev/log/";
         make_dir(base, 0755);
         name += 4;
+8 −0
Original line number Diff line number Diff line
@@ -16,7 +16,11 @@
LOCAL_PATH := $(my-dir)
include $(CLEAR_VARS)

ifeq ($(TARGET_USES_LOGD),true)
liblog_sources := logd_write.c
else
liblog_sources := logd_write_kern.c
endif

# some files must not be compiled when building against Mingw
# they correspond to features not used by our host development tools
@@ -42,7 +46,11 @@ else
endif

liblog_host_sources := $(liblog_sources) fake_log_device.c
ifeq ($(TARGET_USES_LOGD),true)
liblog_target_sources = $(liblog_sources) log_read.c
else
liblog_target_sources = $(liblog_sources) log_read_kern.c
endif

# Shared and static library for host
# ========================================================
Loading