summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn2017-02-06 12:21:56 -0600
committerMark Salyzyn2017-02-07 16:16:09 -0600
commit7048f0b1cbf3e659463c679431f393f12c59d103 (patch)
treed15f6523487086ab7b1dd926de1d4427398b0f1d /liblog/logger.h
parent887b6b9a4b7194627134cf486707ed4fca7c3043 (diff)
downloadplatform-system-core-7048f0b1cbf3e659463c679431f393f12c59d103.tar.gz
platform-system-core-7048f0b1cbf3e659463c679431f393f12c59d103.tar.xz
platform-system-core-7048f0b1cbf3e659463c679431f393f12c59d103.zip
liblog: logger.h fortify comments
Test: none Bug: 27405083 Change-Id: I88ae9f33daa457454edfc5e95cb9e9e74e8cd5f0
Diffstat (limited to 'liblog/logger.h')
-rw-r--r--liblog/logger.h31
1 files changed, 17 insertions, 14 deletions
diff --git a/liblog/logger.h b/liblog/logger.h
index 50d1cb441..d332c0325 100644
--- a/liblog/logger.h
+++ b/liblog/logger.h
@@ -39,14 +39,16 @@ union android_log_context {
39 39
40struct android_log_transport_write { 40struct android_log_transport_write {
41 struct listnode node; 41 struct listnode node;
42 const char *name; 42 const char *name; /* human name to describe the transport */
43 unsigned logMask; /* cache of available success */ 43 unsigned logMask; /* mask cache of available() success */
44 union android_log_context context; /* Initialized by static allocation */ 44 union android_log_context context; /* Initialized by static allocation */
45 45
46 int (*available)(log_id_t logId); 46 int (*available)(log_id_t logId); /* Does not cause resources to be taken */
47 int (*open)(); 47 int (*open)(); /* can be called multiple times, reusing current resources */
48 void (*close)(); 48 void (*close)(); /* free up resources */
49 int (*write)(log_id_t logId, struct timespec *ts, struct iovec *vec, size_t nr); 49 /* write log to transport, returns number of bytes propagated, or -errno */
50 int (*write)(log_id_t logId, struct timespec *ts,
51 struct iovec *vec, size_t nr);
50}; 52};
51 53
52struct android_log_logger_list; 54struct android_log_logger_list;
@@ -55,22 +57,23 @@ struct android_log_logger;
55 57
56struct android_log_transport_read { 58struct android_log_transport_read {
57 struct listnode node; 59 struct listnode node;
58 const char *name; 60 const char *name; /* human name to describe the transport */
59 61
62 /* Does not cause resources to be taken */
60 int (*available)(log_id_t logId); 63 int (*available)(log_id_t logId);
61 int (*version)(struct android_log_logger *logger, 64 int (*version)(struct android_log_logger *logger,
62 struct android_log_transport_context *transp); 65 struct android_log_transport_context *transp);
66 /* Release resources taken by the following interfaces */
63 void (*close)(struct android_log_logger_list *logger_list, 67 void (*close)(struct android_log_logger_list *logger_list,
64 struct android_log_transport_context *transp); 68 struct android_log_transport_context *transp);
65
66 /* 69 /*
67 * Expect all to instantiate open on any call, so we do not have 70 * Expect all to instantiate open automagically on any call,
68 * an expicit open call 71 * so we do not have an explicit open call.
69 */ 72 */
70 int (*read)(struct android_log_logger_list *logger_list, 73 int (*read)(struct android_log_logger_list *logger_list,
71 struct android_log_transport_context *transp, 74 struct android_log_transport_context *transp,
72 struct log_msg *log_msg); 75 struct log_msg *log_msg);
73 /* Assumption is only called if not ANDROID_LOG_NONBLOCK */ 76 /* Must only be called if not ANDROID_LOG_NONBLOCK (blocking) */
74 int (*poll)(struct android_log_logger_list *logger_list, 77 int (*poll)(struct android_log_logger_list *logger_list,
75 struct android_log_transport_context *transp); 78 struct android_log_transport_context *transp);
76 79
@@ -117,9 +120,9 @@ struct android_log_transport_context {
117 struct android_log_logger_list *parent; 120 struct android_log_logger_list *parent;
118 121
119 struct android_log_transport_read *transport; 122 struct android_log_transport_read *transport;
120 unsigned logMask; 123 unsigned logMask; /* mask of requested log buffers */
121 int ret; 124 int ret; /* return value associated with following data */
122 struct log_msg logMsg; /* valid is logMsg.len != 0 */ 125 struct log_msg logMsg; /* peek at upcoming data, valid if logMsg.len != 0 */
123}; 126};
124 127
125/* assumes caller has structures read-locked, single threaded, or fenced */ 128/* assumes caller has structures read-locked, single threaded, or fenced */