-
Notifications
You must be signed in to change notification settings - Fork 3
RDK-60621 - Data Collection Through T2 Events For Components Logging To btmgrlog.txt #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
b7a8755
fa7d62c
ac1ad6f
094a1b5
c42bffd
da04169
051a257
94c0bc5
657a1ae
0d24655
9d54a30
bdc8eb3
feb3ab0
29a00f6
075eb56
f399967
ee2cafe
87da2c1
0b349e5
fe5a0e5
f7241c5
d63dbe5
bb9a45c
44f2bbe
3cd3608
645479b
00a7f3b
3b60fc4
b335f9b
fbbb5f5
f2dfe10
99e4f7e
3fddcc1
4a83822
5aa2a84
f7f90bc
d80657b
4d0f520
ebe7c81
66d5711
8f35900
fbcedeb
24b18ef
3ba43e0
8b97191
29f9d9e
f6ff607
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,60 @@ | ||||||
| /* | ||||||
| * If not stated otherwise in this file or this component's LICENSE file the | ||||||
|
Check failure on line 2 in include/telemetry/bt-telemetry.h
|
||||||
| * following copyright and licenses apply: | ||||||
| * | ||||||
| * Copyright 2016 RDK Management | ||||||
| * | ||||||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||||||
| * you may not use this file except in compliance with the License. | ||||||
| * You may obtain a copy of the License at | ||||||
| * | ||||||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||||||
| * | ||||||
| * Unless required by applicable law or agreed to in writing, software | ||||||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||||||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||||
| * See the License for the specific language governing permissions and | ||||||
| * limitations under the License. | ||||||
| */ | ||||||
| /* | ||||||
| * @file bt-telemetry.h | ||||||
| * Includes telemetry wrapper utilities for Bluetooth Core and Bluetooth Manager | ||||||
| */ | ||||||
|
|
||||||
| #ifndef __BT_TELEMETRY_H__ | ||||||
| #define __BT_TELEMETRY_H__ | ||||||
|
|
||||||
| /** | ||||||
| * @brief Initialize telemetry with component name | ||||||
| * | ||||||
ANANTHMARIMUTHU marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| * @param name Component name for telemetry identification | ||||||
| */ | ||||||
| void telemetry_init(char* name); | ||||||
|
|
||||||
| /** | ||||||
| * @brief Send marker with string value to T2 | ||||||
| * | ||||||
| * @param marker Telemetry marker/event name (use _split suffix for split markers) | ||||||
| * @param value String value to send | ||||||
| */ | ||||||
| void telemetry_event_s(const char* marker, char* value); | ||||||
|
||||||
| void telemetry_event_s(const char* marker, char* value); | |
| void telemetry_event_s(const char* marker, const char* value); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| /* | ||
| * If not stated otherwise in this file or this component's LICENSE file the | ||
|
Check failure on line 2 in src/bt-telemetry.c
|
||
| * following copyright and licenses apply: | ||
| * | ||
| * Copyright 2016 RDK Management | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| /* | ||
| * bt-telemetry.c | ||
| * Implementation of telemetry wrapper utilities for Bluetooth Core and Bluetooth Manager | ||
| */ | ||
|
|
||
| #include <stdio.h> | ||
|
|
||
| #ifdef HAVE_TELEMETRY_MSGSENDER | ||
| #include <telemetry_busmessage_sender.h> | ||
| #endif | ||
|
|
||
| #include "btrCore_logger.h" | ||
| #include "bt-telemetry.h" | ||
|
|
||
| /** | ||
| * @brief Initialize telemetry with component name | ||
| */ | ||
| void telemetry_init(char* name) | ||
| { | ||
ANANTHMARIMUTHU marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| if (name == NULL) { | ||
| BTRCORELOG_ERROR("T2: Failed to initialize telemetry - component name is NULL\n"); | ||
| return; | ||
| } | ||
|
|
||
| #ifdef HAVE_TELEMETRY_MSGSENDER | ||
| BTRCORELOG_INFO("T2: Initializing telemetry with component name=\"%s\"\n", name); | ||
| t2_init(name); | ||
| #else | ||
| BTRCORELOG_INFO("T2: telemetry sender disabled - telemetry_init skipped for \"%s\"\n", name); | ||
| #endif | ||
| } | ||
|
|
||
| /** | ||
| * @brief Send marker with string value to T2 | ||
| */ | ||
| void telemetry_event_s(const char* marker, char* value) | ||
ANANTHMARIMUTHU marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| { | ||
| if (marker == NULL) { | ||
| BTRCORELOG_ERROR("T2: telemetry_event_s - marker is NULL\n"); | ||
| return; | ||
| } | ||
| if (value == NULL) { | ||
| BTRCORELOG_ERROR("T2: telemetry_event_s - value is NULL\n"); | ||
| return; | ||
| } | ||
|
|
||
| #ifdef HAVE_TELEMETRY_MSGSENDER | ||
| T2ERROR t2error = t2_event_s(marker, value); | ||
| if (t2error != T2ERROR_SUCCESS) { | ||
| BTRCORELOG_ERROR("t2_event_s(\"%s\", \"%s\") returned error code %d\n", marker, value, t2error); | ||
| } | ||
| #else | ||
| BTRCORELOG_INFO("T2: telemetry sender disabled - telemetry_event_s skipped for %s\n", marker); | ||
| #endif | ||
| } | ||
ANANTHMARIMUTHU marked this conversation as resolved.
Show resolved
Hide resolved
ANANTHMARIMUTHU marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| /** | ||
| * @brief Send marker with integer value to T2 or report count based markers | ||
| */ | ||
| void telemetry_event_d(const char* marker, int value) | ||
| { | ||
| if (marker == NULL) { | ||
| BTRCORELOG_ERROR("T2: telemetry_event_d - marker is NULL\n"); | ||
| return; | ||
| } | ||
|
|
||
| #ifdef HAVE_TELEMETRY_MSGSENDER | ||
| T2ERROR t2error = t2_event_d(marker, value); | ||
| if (t2error != T2ERROR_SUCCESS) { | ||
| BTRCORELOG_ERROR("t2_event_d(\"%s\", %d) returned error code %d\n", marker, value, t2error); | ||
| } | ||
| #else | ||
| BTRCORELOG_INFO("T2: telemetry sender disabled - telemetry_event_d skipped for %s\n", marker); | ||
| #endif | ||
| } | ||
|
|
||
| /** | ||
| * @brief Send marker with double value to T2 | ||
| */ | ||
| void telemetry_event_f(const char* marker, double value) | ||
| { | ||
| if (marker == NULL) { | ||
| BTRCORELOG_ERROR("T2: telemetry_event_f - marker is NULL\n"); | ||
| return; | ||
| } | ||
|
|
||
| #ifdef HAVE_TELEMETRY_MSGSENDER | ||
| T2ERROR t2error = t2_event_f(marker, value); | ||
| if (t2error != T2ERROR_SUCCESS) { | ||
| BTRCORELOG_ERROR("t2_event_f(\"%s\", %f) returned error code %d\n", marker, value, t2error); | ||
| } | ||
| #else | ||
| BTRCORELOG_INFO("T2: telemetry sender disabled - telemetry_event_f skipped for %s\n", marker); | ||
| #endif | ||
| } | ||
ANANTHMARIMUTHU marked this conversation as resolved.
Show resolved
Hide resolved
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation of TELEMETRY_CFLAGS is inconsistent with the previous line. It should align with the TELEMETRY_MSGLIBS assignment above it.