diff options
author | Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> | 2015-07-28 14:31:31 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-07-31 15:32:42 +1000 |
commit | 56b7f5113e3469620c5a1f8994550c5d72f571a8 (patch) | |
tree | 3cdea0c1b7db95938c23b643b90585e38f2326f2 /include | |
parent | 9949f7cbfe8ae1a92f0e9bb3f6ebe0e8770c6d71 (diff) | |
download | skiboot-56b7f5113e3469620c5a1f8994550c5d72f571a8.zip skiboot-56b7f5113e3469620c5a1f8994550c5d72f571a8.tar.gz skiboot-56b7f5113e3469620c5a1f8994550c5d72f571a8.tar.bz2 |
errorlog: Simplify log calling convention
Remove the callback functionality from log_error() and replace it with
the ability to append to a user data section, or add addtional user
data sections to an error log.
For multiline or otherwise complex logging the convention is now to call
opal_elog_create() to obtain a errorlog buffer and use log_append_msg()
and log_append_data() to append to the user data section. Additional
user data sections can be added to the error log via log_add_section().
The caller is then responsible for calling log_commit().
For simple logs log_simple_error() takes care of creating and committing
the error log as before.
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/errorlog.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/include/errorlog.h b/include/errorlog.h index af9b441..eb37452 100644 --- a/include/errorlog.h +++ b/include/errorlog.h @@ -335,16 +335,18 @@ severity, subtype, callout_func) static struct opal_err_info err_##reason = \ * and commits the error to FSP. * Used for simple error logging */ -void log_simple_error(struct opal_err_info *e_info, const char *fmt, ...) __attribute__ ((format (printf, 2, 3))); -void log_error(struct opal_err_info *e_info, void *data, uint16_t size, - const char *fmt, ...) __attribute__ ((format (printf, 4, 5))); +void log_simple_error(struct opal_err_info *e_info, + const char *fmt, ...) __attribute__ ((format (printf, 2, 3))); #define e_info(reason_code) err_##reason_code -struct errorlog *opal_elog_create(struct opal_err_info *e_info) __warn_unused_result; - -int opal_elog_update_user_dump(struct errorlog *buf, unsigned char *data, - uint32_t tag, uint16_t size); +struct errorlog *opal_elog_create(struct opal_err_info *e_info, + uint32_t tag) __warn_unused_result; +void log_add_section(struct errorlog *buf, uint32_t tag); +void log_append_data(struct errorlog *buf, unsigned char *data, uint16_t size); +void log_append_msg(struct errorlog *buf, + const char *fmt, ...) __attribute__ ((format (printf, 2, 3))); +void log_commit(struct errorlog *elog); /* Called by the backend after an error has been logged by the * backend. If the error could not be logged successfully success is |