From 723b3d36f830dd9425a7affdc5f64a8c2dcdcd45 Mon Sep 17 00:00:00 2001 From: Saya Sugiura Date: Tue, 9 Jul 2019 08:48:39 +0900 Subject: doxygen: Align variable for apid and ctid The variables used for application id and context id are aligned with "apid" and "ctid". Signed-off-by: Saya Sugiura --- doc/dlt-control.1.md | 12 +- include/dlt/dlt_user.h | 4 +- src/console/dlt-control.c | 14 +- src/daemon/dlt_daemon_client.c | 48 +++---- src/daemon/dlt_daemon_client.h | 8 +- src/daemon/dlt_daemon_offline_logstorage.c | 155 +++++++++++---------- .../dlt_daemon_offline_logstorage_internal.h | 6 +- src/dbus/dlt-dbus-options.c | 2 +- src/lib/dlt_user.c | 40 +++--- src/offlinelogstorage/dlt_offline_logstorage.c | 2 +- src/offlinelogstorage/dlt_offline_logstorage.h | 2 +- .../dlt_offline_logstorage_internal.h | 4 +- src/tests/dlt-test-multi-process.c | 8 +- tests/gtest_dlt_daemon_offline_log.cpp | 18 +-- tests/gtest_dlt_user.cpp | 2 +- 15 files changed, 163 insertions(+), 162 deletions(-) diff --git a/doc/dlt-control.1.md b/doc/dlt-control.1.md index 35d86cf..ab509fe 100644 --- a/doc/dlt-control.1.md +++ b/doc/dlt-control.1.md @@ -81,22 +81,22 @@ is used. See example for detail. Set the log level (0=off - 6=verbose, default= -1) supported options: - -l level -a appid -c ctid + -l level -a apid -c ctid -l level -a abc* (set level for all ctxts of apps name starts with abc) - -l level -a appid (set level for all ctxts of this app) + -l level -a apid (set level for all ctxts of this app) -l level -c xyz* (set level for all ctxts whose name starts with xyz) - -l level -c ctxid (set level for the particular ctxt) + -l level -c ctid (set level for the particular ctxt) -l level (set level for all the registered contexts) -r : Set the trace status (0=off - 1=on, default=255) supported options: - -r tracestatus -a appid -c ctid + -r tracestatus -a apid -c ctid -r tracestatus -a abc* (set status for all ctxts of apps name starts with abc) - -r tracestatus -a appid (set status for all ctxts of this app) + -r tracestatus -a apid (set status for all ctxts of this app) -r tracestatus -c xyz* (set status for all ctxts whose name starts with xyz) - -r tracestatus -c ctxid (set status for the particular ctxt) + -r tracestatus -c ctid (set status for the particular ctxt) -r tracestatus (set status for all the registered contexts) -d diff --git a/include/dlt/dlt_user.h b/include/dlt/dlt_user.h index 7774f83..0804f7e 100644 --- a/include/dlt/dlt_user.h +++ b/include/dlt/dlt_user.h @@ -514,11 +514,11 @@ DltReturnValue dlt_check_library_version(const char *user_major_version, const c /** * Register an application in the daemon. - * @param appid four byte long character array with the application id + * @param apid four byte long character array with the application id * @param description long name of the application * @return Value from DltReturnValue enum */ -DltReturnValue dlt_register_app(const char *appid, const char *description); +DltReturnValue dlt_register_app(const char *apid, const char *description); /** * Unregister an application in the daemon. diff --git a/src/console/dlt-control.c b/src/console/dlt-control.c index 13d0c9f..38ffdf5 100644 --- a/src/console/dlt-control.c +++ b/src/console/dlt-control.c @@ -137,19 +137,19 @@ void usage() printf(" -t milliseconds Timeout to terminate application (Default:1000)'\n"); printf(" -l loglevel Set the log level (0=off - 6=verbose default= -1)\n"); printf(" supported options:\n"); - printf(" -l level -a appid -c ctid\n"); + printf(" -l level -a apid -c ctid\n"); printf(" -l level -a abc* (set level for all ctxts of apps name starts with abc)\n"); - printf(" -l level -a appid (set level for all ctxts of this app)\n"); + printf(" -l level -a apid (set level for all ctxts of this app)\n"); printf(" -l level -c xyz* (set level for all ctxts whose name starts with xyz)\n"); - printf(" -l level -c ctxid (set level for the particular ctxt)\n"); + printf(" -l level -c ctid (set level for the particular ctxt)\n"); printf(" -l level (set level for all the registered contexts)\n"); printf(" -r tracestatus Set the trace status (0=off - 1=on,255=default)\n"); printf(" supported options:\n"); - printf(" -r tracestatus -a appid -c ctid\n"); + printf(" -r tracestatus -a apid -c ctid\n"); printf(" -r tracestatus -a abc* (set status for all ctxts of apps name starts with abc)\n"); - printf(" -r tracestatus -a appid (set status for all ctxts of this app)\n"); + printf(" -r tracestatus -a apid (set status for all ctxts of this app)\n"); printf(" -r tracestatus -c xyz* (set status for all ctxts whose name starts with xyz)\n"); - printf(" -r tracestatus -c ctxid (set status for the particular ctxt)\n"); + printf(" -r tracestatus -c ctid (set status for the particular ctxt)\n"); printf(" -r tracestatus (set status for all the registered contexts)\n"); printf(" -d loglevel Set the default log level (0=off - 5=verbose)\n"); printf(" -f tracestatus Set the default trace status (0=off - 1=on)\n"); @@ -288,7 +288,7 @@ int main(int argc, char *argv[]) dltdata.avalue = optarg; if (strlen(dltdata.avalue) > DLT_ID_SIZE) { - fprintf (stderr, "Invalid appid\n"); + fprintf (stderr, "Invalid application id\n"); return -1; } diff --git a/src/daemon/dlt_daemon_client.c b/src/daemon/dlt_daemon_client.c index 6a805e7..b3be3df 100644 --- a/src/daemon/dlt_daemon_client.c +++ b/src/daemon/dlt_daemon_client.c @@ -321,7 +321,7 @@ int dlt_daemon_client_send_control_message(int sock, DltDaemon *daemon, DltDaemonLocal *daemon_local, DltMessage *msg, - char *appid, + char *apid, char *ctid, int verbose) { @@ -330,7 +330,7 @@ int dlt_daemon_client_send_control_message(int sock, PRINT_FUNCTION_VERBOSE(verbose); - if ((daemon == 0) || (msg == 0) || (appid == 0) || (ctid == 0)) + if ((daemon == 0) || (msg == 0) || (apid == 0) || (ctid == 0)) return DLT_DAEMON_ERROR_UNKNOWN; /* prepare storage header */ @@ -366,10 +366,10 @@ int dlt_daemon_client_send_control_message(int sock, msg->extendedheader->noar = 1; /* number of arguments */ - if (strcmp(appid, "") == 0) + if (strcmp(apid, "") == 0) dlt_set_id(msg->extendedheader->apid, DLT_DAEMON_CTRL_APID); /* application id */ else - dlt_set_id(msg->extendedheader->apid, appid); + dlt_set_id(msg->extendedheader->apid, apid); if (strcmp(ctid, "") == 0) dlt_set_id(msg->extendedheader->ctid, DLT_DAEMON_CTRL_CTID); /* context id */ @@ -1665,8 +1665,8 @@ void dlt_daemon_control_set_log_level(int sock, char ctid[DLT_ID_SIZE + 1] = { 0 }; DltServiceSetLogLevel *req = NULL; DltDaemonContext *context = NULL; - int8_t appid_length = 0; - int8_t ctxtid_length = 0; + int8_t apid_length = 0; + int8_t ctid_length = 0; if ((daemon == NULL) || (msg == NULL) || (msg->databuffer == NULL)) return; @@ -1681,31 +1681,31 @@ void dlt_daemon_control_set_log_level(int sock, dlt_set_id(apid, req->apid); dlt_set_id(ctid, req->ctid); - appid_length = strlen(apid); - ctxtid_length = strlen(ctid); + apid_length = strlen(apid); + ctid_length = strlen(ctid); - if ((appid_length != 0) && (apid[appid_length - 1] == '*') && (ctid[0] == 0)) { /*appid provided having '*' in it and ctid is null*/ + if ((apid_length != 0) && (apid[apid_length - 1] == '*') && (ctid[0] == 0)) { /*apid provided having '*' in it and ctid is null*/ dlt_daemon_find_multiple_context_and_send_log_level(sock, daemon, daemon_local, 1, apid, - appid_length - 1, + apid_length - 1, req->log_level, verbose); } - else if ((ctxtid_length != 0) && (ctid[ctxtid_length - 1] == '*') && (apid[0] == 0)) /*ctid provided is having '*' in it and appid is null*/ + else if ((ctid_length != 0) && (ctid[ctid_length - 1] == '*') && (apid[0] == 0)) /*ctid provided is having '*' in it and apid is null*/ { dlt_daemon_find_multiple_context_and_send_log_level(sock, daemon, daemon_local, 0, ctid, - ctxtid_length - 1, + ctid_length - 1, req->log_level, verbose); } - else if ((appid_length != 0) && (apid[appid_length - 1] != '*') && (ctid[0] == 0)) /*only app id case*/ + else if ((apid_length != 0) && (apid[apid_length - 1] != '*') && (ctid[0] == 0)) /*only app id case*/ { dlt_daemon_find_multiple_context_and_send_log_level(sock, daemon, @@ -1716,7 +1716,7 @@ void dlt_daemon_control_set_log_level(int sock, req->log_level, verbose); } - else if ((ctxtid_length != 0) && (ctid[ctxtid_length - 1] != '*') && (apid[0] == 0)) /*only context id case*/ + else if ((ctid_length != 0) && (ctid[ctid_length - 1] != '*') && (apid[0] == 0)) /*only context id case*/ { dlt_daemon_find_multiple_context_and_send_log_level(sock, daemon, @@ -1838,8 +1838,8 @@ void dlt_daemon_control_set_trace_status(int sock, char ctid[DLT_ID_SIZE + 1] = { 0 }; DltServiceSetLogLevel *req = NULL; DltDaemonContext *context = NULL; - int8_t appid_length = 0; - int8_t ctxtid_length = 0; + int8_t apid_length = 0; + int8_t ctid_length = 0; if ((daemon == NULL) || (msg == NULL) || (msg->databuffer == NULL)) return; @@ -1854,20 +1854,20 @@ void dlt_daemon_control_set_trace_status(int sock, dlt_set_id(apid, req->apid); dlt_set_id(ctid, req->ctid); - appid_length = strlen(apid); - ctxtid_length = strlen(ctid); + apid_length = strlen(apid); + ctid_length = strlen(ctid); - if ((appid_length != 0) && (apid[appid_length - 1] == '*') && (ctid[0] == 0)) { /*appid provided having '*' in it and ctid is null*/ + if ((apid_length != 0) && (apid[apid_length - 1] == '*') && (ctid[0] == 0)) { /*apid provided having '*' in it and ctid is null*/ dlt_daemon_find_multiple_context_and_send_trace_status(sock, daemon, daemon_local, 1, apid, - appid_length - 1, + apid_length - 1, req->log_level, verbose); } - else if ((ctxtid_length != 0) && (ctid[ctxtid_length - 1] == '*') && (apid[0] == 0)) /*ctid provided is having '*' in it and appid is null*/ + else if ((ctid_length != 0) && (ctid[ctid_length - 1] == '*') && (apid[0] == 0)) /*ctid provided is having '*' in it and apid is null*/ { dlt_daemon_find_multiple_context_and_send_trace_status(sock, @@ -1875,11 +1875,11 @@ void dlt_daemon_control_set_trace_status(int sock, daemon_local, 0, ctid, - ctxtid_length - 1, + ctid_length - 1, req->log_level, verbose); } - else if ((appid_length != 0) && (apid[appid_length - 1] != '*') && (ctid[0] == 0)) /*only app id case*/ + else if ((apid_length != 0) && (apid[apid_length - 1] != '*') && (ctid[0] == 0)) /*only app id case*/ { dlt_daemon_find_multiple_context_and_send_trace_status(sock, daemon, @@ -1890,7 +1890,7 @@ void dlt_daemon_control_set_trace_status(int sock, req->log_level, verbose); } - else if ((ctxtid_length != 0) && (ctid[ctxtid_length - 1] != '*') && (apid[0] == 0)) /*only context id case*/ + else if ((ctid_length != 0) && (ctid[ctid_length - 1] != '*') && (apid[0] == 0)) /*only context id case*/ { dlt_daemon_find_multiple_context_and_send_trace_status(sock, daemon, diff --git a/src/daemon/dlt_daemon_client.h b/src/daemon/dlt_daemon_client.h index ecfd4d0..80821d2 100644 --- a/src/daemon/dlt_daemon_client.h +++ b/src/daemon/dlt_daemon_client.h @@ -104,8 +104,8 @@ int dlt_daemon_client_send(int sock, * @param daemon pointer to dlt daemon structure * @param daemon_local pointer to dlt daemon local structure * @param msg pointer to response message - * @param appid pointer to application id to be used in response message - * @param contid pointer to context id to be used in response message + * @param apid pointer to application id to be used in response message + * @param ctid pointer to context id to be used in response message * @param verbose if set to true verbose information is printed out. * @return -1 if there is an error or buffer is full */ @@ -113,8 +113,8 @@ int dlt_daemon_client_send_control_message(int sock, DltDaemon *daemon, DltDaemonLocal *daemon_local, DltMessage *msg, - char *appid, - char *contid, + char *apid, + char *ctid, int verbose); /** * Process and generate response to received get log info control message diff --git a/src/daemon/dlt_daemon_offline_logstorage.c b/src/daemon/dlt_daemon_offline_logstorage.c index 2d28796..4e9c6c6 100644 --- a/src/daemon/dlt_daemon_offline_logstorage.c +++ b/src/daemon/dlt_daemon_offline_logstorage.c @@ -36,22 +36,22 @@ * @param key Key * @param len Key length * @param ecuid ECU ID from key stored here - * @param appid Application ID as .* stored here - * @param ctxid Context id as .* stored here + * @param apid Application ID as .* stored here + * @param ctid Context id as .* stored here * @return 0 on success -1 on error */ DLT_STATIC DltReturnValue dlt_logstorage_split_ecuid(char *key, int len, char *ecuid, - char *appid, - char *ctxid) + char *apid, + char *ctid) { if ((len > (DLT_ID_SIZE + 2)) || (len < 2)) return DLT_RETURN_ERROR; strncpy(ecuid, key, (len - 2)); - strncpy(appid, ".*", 2); - strncpy(ctxid, ".*", 2); + strncpy(apid, ".*", 2); + strncpy(ctid, ".*", 2); return DLT_RETURN_OK; } @@ -63,20 +63,20 @@ DLT_STATIC DltReturnValue dlt_logstorage_split_ecuid(char *key, * * @param key Key * @param len Key length - * @param appid Application ID as .* stored here - * @param ctxid Context id from key stored here + * @param apid Application ID as .* stored here + * @param ctid Context id from key stored here * @return 0 on success -1 on error */ DLT_STATIC DltReturnValue dlt_logstorage_split_ctid(char *key, int len, - char *appid, - char *ctxid) + char *apid, + char *ctid) { if ((len > (DLT_ID_SIZE + 2)) || (len < 1)) return DLT_RETURN_ERROR; - strncpy(ctxid, (key + 2), (len - 1)); - strncpy(appid, ".*", 2); + strncpy(ctid, (key + 2), (len - 1)); + strncpy(apid, ".*", 2); return DLT_RETURN_OK; } @@ -88,20 +88,20 @@ DLT_STATIC DltReturnValue dlt_logstorage_split_ctid(char *key, * * @param key Key * @param len Key length - * @param appid Application ID from key is stored here - * @param ctxid Context id as .* stored here + * @param apid Application ID from key is stored here + * @param ctid Context id as .* stored here * @return 0 on success -1 on error */ DLT_STATIC DltReturnValue dlt_logstorage_split_apid(char *key, int len, - char *appid, - char *ctxid) + char *apid, + char *ctid) { if ((len > (DLT_ID_SIZE + 2)) || (len < 2)) return DLT_RETURN_ERROR; - strncpy(appid, key + 1, (len - 2)); - strncpy(ctxid, ".*", 2); + strncpy(apid, key + 1, (len - 2)); + strncpy(ctid, ".*", 2); return DLT_RETURN_OK; } @@ -113,32 +113,32 @@ DLT_STATIC DltReturnValue dlt_logstorage_split_apid(char *key, * * @param key Key * @param len Key length - * @param appid Application ID from key is stored here - * @param ctxid CContext id from key is stored here + * @param apid Application ID from key is stored here + * @param ctid CContext id from key is stored here * @return 0 on success -1 on error */ DLT_STATIC DltReturnValue dlt_logstorage_split_apid_ctid(char *key, int len, - char *appid, - char *ctxid) + char *apid, + char *ctid) { char *tok = NULL; if (len > DLT_OFFLINE_LOGSTORAGE_MAX_KEY_LEN) return DLT_RETURN_ERROR; - /* copy appid and ctxid */ + /* copy apid and ctid */ tok = strtok(key, ":"); if (tok != NULL) - strncpy(appid, tok, DLT_ID_SIZE); + strncpy(apid, tok, DLT_ID_SIZE); else return DLT_RETURN_ERROR; tok = strtok(NULL, ":"); if (tok != NULL) - strncpy(ctxid, tok, DLT_ID_SIZE); + strncpy(ctid, tok, DLT_ID_SIZE); else return DLT_RETURN_ERROR; @@ -153,22 +153,22 @@ DLT_STATIC DltReturnValue dlt_logstorage_split_apid_ctid(char *key, * @param key Key * @param len Key length * @param ecuid ECU ID from key stored here - * @param appid Application ID from key is stored here - * @param ctxid CContext id as .* stored here + * @param apid Application ID from key is stored here + * @param ctid Context id as .* stored here * @return 0 on success -1 on error */ DLT_STATIC DltReturnValue dlt_logstorage_split_ecuid_apid(char *key, int len, char *ecuid, - char *appid, - char *ctxid) + char *apid, + char *ctid) { char *tok = NULL; if (len > DLT_OFFLINE_LOGSTORAGE_MAX_KEY_LEN) return DLT_RETURN_ERROR; - /* copy appid and ctxid */ + /* copy apid and ctid */ tok = strtok(key, ":"); if (tok != NULL) @@ -179,11 +179,11 @@ DLT_STATIC DltReturnValue dlt_logstorage_split_ecuid_apid(char *key, tok = strtok(NULL, ":"); if (tok != NULL) - strncpy(appid, tok, DLT_ID_SIZE); + strncpy(apid, tok, DLT_ID_SIZE); else return DLT_RETURN_ERROR; - strncpy(ctxid, ".*", 2); + strncpy(ctid, ".*", 2); return DLT_RETURN_OK; } @@ -192,20 +192,20 @@ DLT_STATIC DltReturnValue dlt_logstorage_split_ecuid_apid(char *key, * dlt_logstorage_split_multi * * Prepares keys with application ID alone, will use ecuid if provided - * (ecuid:apid::) or (:apid::) + * (ecuid\:apid\:\:) or (\:apid\:\:) * * @param key Prepared key stored here * @param len Key length * @param ecuid ECU ID - * @param appid Application ID - * @param ctxid Context ID + * @param apid Application ID + * @param ctid Context ID * @return None */ DLT_STATIC DltReturnValue dlt_logstorage_split_multi(char *key, int len, char *ecuid, - char *appid, - char *ctxid) + char *apid, + char *ctid) { char *tok = NULL; @@ -225,16 +225,16 @@ DLT_STATIC DltReturnValue dlt_logstorage_split_multi(char *key, tok = strtok(NULL, ":"); if (tok != NULL) - strncpy(ctxid, tok, DLT_ID_SIZE); + strncpy(ctid, tok, DLT_ID_SIZE); - strncpy(appid, ".*", 2); + strncpy(apid, ".*", 2); } else { strncpy(ecuid, tok, DLT_ID_SIZE); tok = strtok(NULL, ":"); - strncpy(appid, tok, DLT_ID_SIZE); + strncpy(apid, tok, DLT_ID_SIZE); tok = strtok(NULL, ":"); - strncpy(ctxid, tok, DLT_ID_SIZE); + strncpy(ctid, tok, DLT_ID_SIZE); } return DLT_RETURN_OK; @@ -243,23 +243,24 @@ DLT_STATIC DltReturnValue dlt_logstorage_split_multi(char *key, /** * dlt_logstorage_split_key * - * Split a given key into appid and ctxid. - * If APID: - appid = APID and ctxid = .* - * If :CTID - ctxid = CTID and appid = .* - * Else appid = APID and ctxid = CTID + * Split a given key into apid and ctid. + * If APID\: - apid = APID and ctid = .* + * If \:CTID - ctid = CTID and apid = .* + * Else apid = APID and ctid = CTID * * @param key Given key of filter hash map - * @param appid Application id - * @param ctxid Context id + * @param apid Application id + * @param ctid Context id * @param ecuid ECU id * @return 0 on success, -1 on error */ -DLT_STATIC DltReturnValue dlt_logstorage_split_key(char *key, char *appid, char *ctxid, char *ecuid) +DLT_STATIC DltReturnValue dlt_logstorage_split_key(char *key, char *apid, + char *ctid, char *ecuid) { int len = 0; char *sep = NULL; - if ((key == NULL) || (appid == NULL) || (ctxid == NULL) || (ecuid == NULL)) + if ((key == NULL) || (apid == NULL) || (ctid == NULL) || (ecuid == NULL)) return DLT_RETURN_WRONG_PARAMETER; len = strlen(key); @@ -271,22 +272,22 @@ DLT_STATIC DltReturnValue dlt_logstorage_split_key(char *key, char *appid, char /* key is ecuid only ecuid::*/ if ((key[len - 1] == ':') && (key[len - 2] == ':')) - return dlt_logstorage_split_ecuid(key, len, ecuid, appid, ctxid); + return dlt_logstorage_split_ecuid(key, len, ecuid, apid, ctid); /* key is context id only ::apid*/ else if ((key[0] == ':') && (key[1] == ':')) - return dlt_logstorage_split_ctid(key, len, appid, ctxid); + return dlt_logstorage_split_ctid(key, len, apid, ctid); /* key is application id only :apid: */ else if ((key[0] == ':') && (key[len - 1] == ':')) - return dlt_logstorage_split_apid(key, len, appid, ctxid); + return dlt_logstorage_split_apid(key, len, apid, ctid); /* key is :apid:ctid */ else if ((key[0] == ':') && (key[len - 1] != ':')) - return dlt_logstorage_split_apid_ctid(key, len, appid, ctxid); + return dlt_logstorage_split_apid_ctid(key, len, apid, ctid); /* key is ecuid:apid: */ else if ((key[0] != ':') && (key[len - 1] == ':')) - return dlt_logstorage_split_ecuid_apid(key, len, ecuid, appid, ctxid); + return dlt_logstorage_split_ecuid_apid(key, len, ecuid, apid, ctid); /* key is either ecuid::ctid or ecuid:apid:ctid */ else - return dlt_logstorage_split_multi(key, len, ecuid, appid, ctxid); + return dlt_logstorage_split_multi(key, len, ecuid, apid, ctid); } /** @@ -469,7 +470,7 @@ DLT_STATIC DltReturnValue dlt_daemon_logstorage_reset_log_level(DltDaemon *daemo * @param daemon DltDaemon structure * @param daemon_local DltDaemonLocal structure * @param apid Application ID - * @param ctxid Context ID + * @param ctid Context ID * @param ecuid ECU ID * @param loglevel log level to be set to context * @param verbose If set to true verbose information is printed out @@ -478,7 +479,7 @@ DLT_STATIC DltReturnValue dlt_daemon_logstorage_reset_log_level(DltDaemon *daemo DLT_STATIC DltReturnValue dlt_daemon_logstorage_force_reset_level(DltDaemon *daemon, DltDaemonLocal *daemon_local, char *apid, - char *ctxid, + char *ctid, char *ecuid, int loglevel, int verbose) @@ -489,13 +490,13 @@ DLT_STATIC DltReturnValue dlt_daemon_logstorage_force_reset_level(DltDaemon *dae DltLogStorageFilterConfig *config[DLT_CONFIG_FILE_SECTIONS_MAX] = { 0 }; if ((daemon == NULL) || (daemon_local == NULL) || (ecuid == NULL) || - (apid == NULL) || (ctxid == NULL) || (loglevel > DLT_LOG_VERBOSE) || (loglevel < DLT_LOG_DEFAULT)) { + (apid == NULL) || (ctid == NULL) || (loglevel > DLT_LOG_VERBOSE) || (loglevel < DLT_LOG_DEFAULT)) { dlt_vlog(LOG_ERR, "%s: Wrong parameter\n", __func__); return DLT_RETURN_WRONG_PARAMETER; } for (i = 0; i < daemon_local->flags.offlineLogstorageMaxDevices; i++) { - num = dlt_logstorage_get_config(&(daemon->storage_handle[i]), config, apid, ctxid, ecuid); + num = dlt_logstorage_get_config(&(daemon->storage_handle[i]), config, apid, ctid, ecuid); if (num > 0) break; /* found config */ @@ -504,7 +505,7 @@ DLT_STATIC DltReturnValue dlt_daemon_logstorage_force_reset_level(DltDaemon *dae if ((num == 0) || (config[0] == NULL)) { dlt_vlog(LOG_ERR, "%s: No information about APID: %s, CTID: %s, ECU: %s in Logstorage configuration\n", - __func__, apid, ctxid, ecuid); + __func__, apid, ctid, ecuid); return DLT_RETURN_ERROR; } @@ -514,7 +515,7 @@ DLT_STATIC DltReturnValue dlt_daemon_logstorage_force_reset_level(DltDaemon *dae ll = config[0]->log_level; return dlt_daemon_logstorage_update_passive_node_context(daemon_local, apid, - ctxid, ecuid, ll, verbose); + ctid, ecuid, ll, verbose); } @@ -532,7 +533,7 @@ DLT_STATIC DltReturnValue dlt_daemon_logstorage_force_reset_level(DltDaemon *dae * @param daemon_local DltDaemonLocal structure * @param id application id or context id * @param curr_log_level log level to be set to context - * @param cmp_flag compare flag (1 id is apid, 2 id is ctxid) + * @param cmp_flag compare flag (1 id is apid, 2 id is ctid) * @param ecuid ecu id where application runs * @param verbose If set to true verbose information is printed out * @return 0 on success, -1 on error @@ -599,7 +600,7 @@ DltReturnValue dlt_logstorage_update_all_contexts(DltDaemon *daemon, * @param daemon DltDaemon structure * @param daemon_local DltDaemonLocal structure * @param apid application id - * @param ctxid context id + * @param ctid context id * @param ecuid ecu id * @param curr_log_level log level to be set to context * @param verbose If set to true verbose information is printed out @@ -608,7 +609,7 @@ DltReturnValue dlt_logstorage_update_all_contexts(DltDaemon *daemon, DltReturnValue dlt_logstorage_update_context(DltDaemon *daemon, DltDaemonLocal *daemon_local, char *apid, - char *ctxid, + char *ctid, char *ecuid, int curr_log_level, int verbose) @@ -616,12 +617,12 @@ DltReturnValue dlt_logstorage_update_context(DltDaemon *daemon, DltDaemonContext *context = NULL; if ((daemon == NULL) || (daemon_local == NULL) || (apid == NULL) - || (ctxid == NULL) || (ecuid == NULL)) { + || (ctid == NULL) || (ecuid == NULL)) { dlt_vlog(LOG_ERR, "Wrong parameter in function %s\n", __func__); return DLT_RETURN_WRONG_PARAMETER; } - context = dlt_daemon_context_find(daemon, apid, ctxid, ecuid, verbose); + context = dlt_daemon_context_find(daemon, apid, ctid, ecuid, verbose); if (context != NULL) { if (curr_log_level > 0) @@ -646,7 +647,7 @@ DltReturnValue dlt_logstorage_update_context(DltDaemon *daemon, return dlt_daemon_logstorage_force_reset_level(daemon, daemon_local, apid, - ctxid, + ctid, ecuid, curr_log_level, verbose); @@ -656,7 +657,7 @@ DltReturnValue dlt_logstorage_update_context(DltDaemon *daemon, "%s: No information about APID: %s, CTID: %s, ECU: %s\n", __func__, apid, - ctxid, + ctid, ecuid); return DLT_RETURN_ERROR; @@ -685,8 +686,8 @@ DltReturnValue dlt_logstorage_update_context_loglevel(DltDaemon *daemon, int verbose) { int cmp_flag = 0; - char appid[DLT_ID_SIZE + 1] = { '\0' }; - char ctxid[DLT_ID_SIZE + 1] = { '\0' }; + char apid[DLT_ID_SIZE + 1] = { '\0' }; + char ctid[DLT_ID_SIZE + 1] = { '\0' }; char ecuid[DLT_ID_SIZE + 1] = { '\0' }; PRINT_FUNCTION_VERBOSE(verbose); @@ -694,7 +695,7 @@ DltReturnValue dlt_logstorage_update_context_loglevel(DltDaemon *daemon, if ((daemon == NULL) || (daemon_local == NULL) || (key == NULL)) return DLT_RETURN_WRONG_PARAMETER; - if (dlt_logstorage_split_key(key, appid, ctxid, ecuid) != 0) { + if (dlt_logstorage_split_key(key, apid, ctid, ecuid) != 0) { dlt_log(LOG_ERR, "Error while updating application log levels (split key)\n"); return DLT_RETURN_ERROR; @@ -704,12 +705,12 @@ DltReturnValue dlt_logstorage_update_context_loglevel(DltDaemon *daemon, dlt_set_id(ecuid, daemon->ecuid); /* wildcard for context id, find all contexts of given application id */ - if (strcmp(ctxid, ".*") == 0) { + if (strcmp(ctid, ".*") == 0) { cmp_flag = DLT_DAEMON_LOGSTORAGE_CMP_APID; if (dlt_logstorage_update_all_contexts(daemon, daemon_local, - appid, + apid, curr_log_level, cmp_flag, ecuid, @@ -717,13 +718,13 @@ DltReturnValue dlt_logstorage_update_context_loglevel(DltDaemon *daemon, return DLT_RETURN_ERROR; } /* wildcard for application id, find all contexts with context id */ - else if (strcmp(appid, ".*") == 0) + else if (strcmp(apid, ".*") == 0) { cmp_flag = DLT_DAEMON_LOGSTORAGE_CMP_CTID; if (dlt_logstorage_update_all_contexts(daemon, daemon_local, - ctxid, + ctid, curr_log_level, cmp_flag, ecuid, @@ -734,8 +735,8 @@ DltReturnValue dlt_logstorage_update_context_loglevel(DltDaemon *daemon, * find function */ else if (dlt_logstorage_update_context(daemon, daemon_local, - appid, - ctxid, + apid, + ctid, ecuid, curr_log_level, verbose) != 0) diff --git a/src/daemon/dlt_daemon_offline_logstorage_internal.h b/src/daemon/dlt_daemon_offline_logstorage_internal.h index 00b8160..0e43886 100644 --- a/src/daemon/dlt_daemon_offline_logstorage_internal.h +++ b/src/daemon/dlt_daemon_offline_logstorage_internal.h @@ -49,8 +49,8 @@ #define DLT_DAEMON_OFFLINE_LOGSTORAGE_INTERNAL_H DLT_STATIC DltReturnValue dlt_logstorage_split_key(char *key, - char *appid, - char *ctxid, + char *apid, + char *ctid, char *ecuid); DltReturnValue dlt_logstorage_update_all_contexts(DltDaemon *daemon, @@ -64,7 +64,7 @@ DltReturnValue dlt_logstorage_update_all_contexts(DltDaemon *daemon, DltReturnValue dlt_logstorage_update_context(DltDaemon *daemon, DltDaemonLocal *daemon_local, char *apid, - char *ctxid, + char *ctid, char *ecuid, int curr_log_level, int verbose); diff --git a/src/dbus/dlt-dbus-options.c b/src/dbus/dlt-dbus-options.c index 1411ffc..88e13fa 100644 --- a/src/dbus/dlt-dbus-options.c +++ b/src/dbus/dlt-dbus-options.c @@ -43,7 +43,7 @@ void usage(char *prog_name) printf("Options:\n"); printf(" -d Daemonize. Detach from terminal and run in background.\n"); printf(" -c filename Use configuration file. \n"); - printf(" -a appid Used application id. \n"); + printf(" -a apid Used application id. \n"); printf(" Default: %s\n", DEFAULT_CONF_FILE); printf(" -b type Used bus type. \n"); printf(" Session = 0, System = 1.\n"); diff --git a/src/lib/dlt_user.c b/src/lib/dlt_user.c index bac2758..d603783 100644 --- a/src/lib/dlt_user.c +++ b/src/lib/dlt_user.c @@ -146,7 +146,7 @@ static DltReturnValue dlt_user_log_send_register_application(void); static DltReturnValue dlt_user_log_send_unregister_application(void); static DltReturnValue dlt_user_log_send_register_context(DltContextData *log); static DltReturnValue dlt_user_log_send_unregister_context(DltContextData *log); -static DltReturnValue dlt_send_app_ll_ts_limit(const char *appid, +static DltReturnValue dlt_send_app_ll_ts_limit(const char *apid, DltLogLevelType loglevel, DltTraceStatusType tracestatus); static DltReturnValue dlt_user_log_send_log_mode(DltUserLogMode mode); @@ -930,7 +930,7 @@ DltReturnValue dlt_check_library_version(const char *user_major_version, const c return dlt_user_check_library_version(user_major_version, user_minor_version); } -DltReturnValue dlt_register_app(const char *appid, const char *description) +DltReturnValue dlt_register_app(const char *apid, const char *description) { DltReturnValue ret = DLT_RETURN_OK; @@ -945,38 +945,38 @@ DltReturnValue dlt_register_app(const char *appid, const char *description) } } - if ((appid == NULL) || (appid[0] == '\0')) + if ((apid == NULL) || (apid[0] == '\0')) return DLT_RETURN_WRONG_PARAMETER; /* check if application already registered */ /* if yes do not register again */ - if (appid[1] == 0) { - if (appid[0] == dlt_user.appID[0]) + if (apid[1] == 0) { + if (apid[0] == dlt_user.appID[0]) return DLT_RETURN_OK; } - else if (appid[2] == 0) + else if (apid[2] == 0) { - if ((appid[0] == dlt_user.appID[0]) && - (appid[1] == dlt_user.appID[1])) + if ((apid[0] == dlt_user.appID[0]) && + (apid[1] == dlt_user.appID[1])) return DLT_RETURN_OK; } - else if (appid[3] == 0) + else if (apid[3] == 0) { - if ((appid[0] == dlt_user.appID[0]) && - (appid[1] == dlt_user.appID[1]) && - (appid[2] == dlt_user.appID[2])) + if ((apid[0] == dlt_user.appID[0]) && + (apid[1] == dlt_user.appID[1]) && + (apid[2] == dlt_user.appID[2])) return DLT_RETURN_OK; } - else if ((appid[0] == dlt_user.appID[0]) && - (appid[1] == dlt_user.appID[1]) && - (appid[2] == dlt_user.appID[2]) && - (appid[3] == dlt_user.appID[3])) + else if ((apid[0] == dlt_user.appID[0]) && + (apid[1] == dlt_user.appID[1]) && + (apid[2] == dlt_user.appID[2]) && + (apid[3] == dlt_user.appID[3])) return DLT_RETURN_OK; DLT_SEM_LOCK(); /* Store locally application id and application description */ - dlt_set_id(dlt_user.appID, appid); + dlt_set_id(dlt_user.appID, apid); if (dlt_user.application_description != NULL) free(dlt_user.application_description); @@ -3896,7 +3896,7 @@ DltReturnValue dlt_user_log_send_unregister_context(DltContextData *log) return DLT_RETURN_OK; } -DltReturnValue dlt_send_app_ll_ts_limit(const char *appid, DltLogLevelType loglevel, DltTraceStatusType tracestatus) +DltReturnValue dlt_send_app_ll_ts_limit(const char *apid, DltLogLevelType loglevel, DltTraceStatusType tracestatus) { DltUserHeader userheader; DltUserControlMsgAppLogLevelTraceStatus usercontext; @@ -3912,7 +3912,7 @@ DltReturnValue dlt_send_app_ll_ts_limit(const char *appid, DltLogLevelType logle return DLT_RETURN_ERROR; } - if ((appid == NULL) || (appid[0] == '\0')) + if ((apid == NULL) || (apid[0] == '\0')) return DLT_RETURN_ERROR; /* set userheader */ @@ -3920,7 +3920,7 @@ DltReturnValue dlt_send_app_ll_ts_limit(const char *appid, DltLogLevelType logle return DLT_RETURN_ERROR; /* set usercontext */ - dlt_set_id(usercontext.apid, appid); /* application id */ + dlt_set_id(usercontext.apid, apid); /* application id */ usercontext.log_level = loglevel; usercontext.trace_status = tracestatus; diff --git a/src/offlinelogstorage/dlt_offline_logstorage.c b/src/offlinelogstorage/dlt_offline_logstorage.c index 5fd24ec..2a52951 100644 --- a/src/offlinelogstorage/dlt_offline_logstorage.c +++ b/src/offlinelogstorage/dlt_offline_logstorage.c @@ -657,7 +657,7 @@ DLT_STATIC int dlt_logstorage_create_keys(char *apids, /* obtain key list and number of keys for application ids */ if (dlt_logstorage_get_keys_list(apids, ",", &apid_list, &num_apids) != 0) { - dlt_log(LOG_ERR, "Failed to obtain appid, check configuration file \n"); + dlt_log(LOG_ERR, "Failed to obtain apid, check configuration file \n"); return -1; } diff --git a/src/offlinelogstorage/dlt_offline_logstorage.h b/src/offlinelogstorage/dlt_offline_logstorage.h index 6f106b0..d9465d2 100644 --- a/src/offlinelogstorage/dlt_offline_logstorage.h +++ b/src/offlinelogstorage/dlt_offline_logstorage.h @@ -270,7 +270,7 @@ int dlt_logstorage_device_disconnected(DltLogStorage *handle, * @param config Pointer to array of filter configurations * @param apid application id * @param ctid context id - * @param ecutid ecu id + * @param ecuid ecu id * @return number of found configurations */ int dlt_logstorage_get_config(DltLogStorage *handle, diff --git a/src/offlinelogstorage/dlt_offline_logstorage_internal.h b/src/offlinelogstorage/dlt_offline_logstorage_internal.h index 4c5f422..d150b6f 100644 --- a/src/offlinelogstorage/dlt_offline_logstorage_internal.h +++ b/src/offlinelogstorage/dlt_offline_logstorage_internal.h @@ -95,8 +95,8 @@ DLT_STATIC int dlt_logstorage_store_filters(DltLogStorage *handle, void dlt_logstorage_free(DltLogStorage *handle, int reason); -DLT_STATIC int dlt_logstorage_create_keys(char *appids, - char *ctxids, +DLT_STATIC int dlt_logstorage_create_keys(char *apids, + char *ctids, char *ecuid, char **keys, int *num_keys); diff --git a/src/tests/dlt-test-multi-process.c b/src/tests/dlt-test-multi-process.c index fdaa98b..56248e1 100644 --- a/src/tests/dlt-test-multi-process.c +++ b/src/tests/dlt-test-multi-process.c @@ -72,7 +72,7 @@ typedef struct { int nthreads; /* Number of threads to start */ int delay; /* Delay between logs messages for each process */ int delay_fudge; /* Fudge the delay by 0-n to cause desynchronization */ - bool generate_ctxid; /* true: To generate context Id from App Id + Thread Number */ + bool generate_ctid; /* true: To generate context Id from App Id + Thread Number */ } s_parameters; typedef struct { @@ -130,7 +130,7 @@ void init_params(s_parameters *params) params->nthreads = 2; params->delay = 1000; params->delay_fudge = 100; - params->generate_ctxid = false; + params->generate_ctid = false; } /** @@ -171,7 +171,7 @@ int read_cli(s_parameters *params, int argc, char **argv) params->delay_fudge = atoi(optarg); break; case 'g': - params->generate_ctxid = true; + params->generate_ctid = true; break; case '?': @@ -315,7 +315,7 @@ void do_logging(s_thread_data *data) struct timespec ts; time_t sleep_time; - if(data->params.generate_ctxid) + if(data->params.generate_ctid) snprintf(ctid, 5, "%02u%02u", data->pidcount, data->tidcount); else snprintf(ctid, 5, "CT%02u", data->tidcount); diff --git a/tests/gtest_dlt_daemon_offline_log.cpp b/tests/gtest_dlt_daemon_offline_log.cpp index a48146f..dd97c5a 100644 --- a/tests/gtest_dlt_daemon_offline_log.cpp +++ b/tests/gtest_dlt_daemon_offline_log.cpp @@ -1029,24 +1029,24 @@ TEST(t_dlt_logstorage_write_msg_cache, null) TEST(t_dlt_logstorage_split_key, normal) { char key[] = "dlt:1020:"; - char appid[] = ":2345:"; - char ctxid[] = "::6789"; + char apid[] = ":2345:"; + char ctid[] = "::6789"; char ecuid[] = "ECU1"; - EXPECT_EQ(DLT_RETURN_OK, dlt_logstorage_split_key(key, appid, ctxid, ecuid)); + EXPECT_EQ(DLT_RETURN_OK, dlt_logstorage_split_key(key, apid, ctid, ecuid)); } TEST(t_dlt_logstorage_split_key, null) { char key[] = "dlt:1020:"; - char appid[] = "2345"; - char ctxid[] = "6789"; + char apid[] = "2345"; + char ctid[] = "6789"; char ecuid[] = "ECU1"; EXPECT_EQ(DLT_RETURN_WRONG_PARAMETER, dlt_logstorage_split_key(NULL, NULL, NULL, NULL)); - EXPECT_EQ(DLT_RETURN_WRONG_PARAMETER, dlt_logstorage_split_key(NULL, appid, ctxid, ecuid)); - EXPECT_EQ(DLT_RETURN_WRONG_PARAMETER, dlt_logstorage_split_key(key, NULL, ctxid, ecuid)); - EXPECT_EQ(DLT_RETURN_WRONG_PARAMETER, dlt_logstorage_split_key(key, appid, NULL, ecuid)); - EXPECT_EQ(DLT_RETURN_WRONG_PARAMETER, dlt_logstorage_split_key(key, appid, ctxid, NULL)); + EXPECT_EQ(DLT_RETURN_WRONG_PARAMETER, dlt_logstorage_split_key(NULL, apid, ctid, ecuid)); + EXPECT_EQ(DLT_RETURN_WRONG_PARAMETER, dlt_logstorage_split_key(key, NULL, ctid, ecuid)); + EXPECT_EQ(DLT_RETURN_WRONG_PARAMETER, dlt_logstorage_split_key(key, apid, NULL, ecuid)); + EXPECT_EQ(DLT_RETURN_WRONG_PARAMETER, dlt_logstorage_split_key(key, apid, ctid, NULL)); } /* Begin Method: dlt_logstorage::t_dlt_logstorage_update_all_contexts*/ diff --git a/tests/gtest_dlt_user.cpp b/tests/gtest_dlt_user.cpp index 7c36178..a910f01 100644 --- a/tests/gtest_dlt_user.cpp +++ b/tests/gtest_dlt_user.cpp @@ -79,7 +79,7 @@ extern "C" { */ /* - * int dlt_register_app(const char *appid, const char * description); + * int dlt_register_app(const char *apid, const char * description); * int dlt_unregister_app(void); * int dlt_register_context(DltContext *handle, const char *contextid, const char * description); * int dlt_register_context_ll_ts(DltContext *handle, const char *contextid, const char * description, int loglevel, int tracestatus); -- cgit v1.2.1