Merge commit 'ba782a8fafdc8fd6a3d9301bd4f64e4f11616951' into nanostack_release_14_0_0_to_5_15

* commit 'ba782a8fafdc8fd6a3d9301bd4f64e4f11616951':
  Squashed 'features/frameworks/mbed-trace/' changes from b98f6a9050..425669d6b1
pull/14833/head
Arto Kinnunen 2021-06-28 09:56:51 +03:00
commit a16465822a
4 changed files with 41 additions and 9 deletions

View File

@ -58,6 +58,7 @@ The purpose of the library is to provide a light, simple and general tracing sol
### Enabling the tracing API in mbed OS 5
* Add the feature COMMON_PAL into the build
* Set `MBED_CONF_MBED_TRACE_ENABLE` to 1 or true
To do so, add the following to your mbed_app.json:
@ -66,6 +67,7 @@ To do so, add the following to your mbed_app.json:
{
"target_overrides": {
"*": {
"target.features_add": ["COMMON_PAL"],
"mbed-trace.enable": 1
}
}

View File

@ -0,0 +1,37 @@
// ----------------------------------------------------------------------------
// Copyright 2015-2021 Pelion.
//
// SPDX-License-Identifier: Apache-2.0
//
// 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 ns_trace.h
* Trace interface abstraction for NanoStack library as well as application.
*
* This file was moved to this library for legacy compatibility
* Actual used trace library is mbed-trace. For usage details check mbed_trace.h.
*
*/
#ifndef NS_TRACE_H_
#define NS_TRACE_H_
#if defined(HAVE_DEBUG) && !defined(FEA_TRACE_SUPPORT)
#define FEA_TRACE_SUPPORT
#endif
#include "ns_types.h"
#include "mbed-trace/mbed_trace.h"
#endif /* NS_TRACE_H_ */

View File

@ -14,15 +14,7 @@
"fea-ipv6": {
"help": "Used to globally disable ipv6 tracing features.",
"value": null
},
"allocator": {
"value": "malloc",
"macro_name": "MEM_ALLOC"
},
"deallocator": {
"value": "free",
"macro_name": "MEM_FREE"
}
}
}
}

View File

@ -202,6 +202,7 @@ void mbed_trace_free(void)
m_trace.line_length = DEFAULT_TRACE_LINE_LENGTH;
m_trace.tmp_data = 0;
m_trace.tmp_data_length = DEFAULT_TRACE_TMP_LINE_LEN;
m_trace.tmp_data_ptr = 0;
m_trace.prefix_f = 0;
m_trace.suffix_f = 0;
m_trace.printf = mbed_trace_default_print;