summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xCMakeLists.txt126
-rwxr-xr-xLIMITATIONS11
-rwxr-xr-xREADME.txt4
-rwxr-xr-xReleaseNotes.txt8
-rwxr-xr-xinclude/dlt/CMakeLists.txt2
-rwxr-xr-xinclude/dlt/dlt_common.h12
-rwxr-xr-xinclude/dlt/dlt_user.h10
-rwxr-xr-xinclude/dlt/dlt_user_macros.h97
-rwxr-xr-xinclude/dlt/dlt_version.h12
-rwxr-xr-xinclude/dlt/dlt_version.h.cmake12
-rwxr-xr-xsrc/adaptor/CMakeLists.txt6
-rwxr-xr-xsrc/console/CMakeLists.txt6
-rwxr-xr-xsrc/daemon/CMakeLists.txt3
-rwxr-xr-xsrc/daemon/dlt-daemon.c3
-rwxr-xr-xsrc/examples/CMakeLists.txt6
-rwxr-xr-xsrc/examples/dlt-example-user-func.c2
-rwxr-xr-xsrc/lib/CMakeLists.txt6
-rwxr-xr-xsrc/lib/dlt_user.c22
-rwxr-xr-xsrc/lib/dlt_user_cfg.h3
-rwxr-xr-xsrc/shared/dlt_common.c16
-rwxr-xr-xsrc/tests/CMakeLists.txt12
-rwxr-xr-xsvnversion.h.cmake2
-rwxr-xr-xsystemd/dlt-syslog.service.cmake18
-rwxr-xr-xsystemd/dlt.service.cmake (renamed from systemd/dlt.service)3
-rwxr-xr-xversion.h7
-rwxr-xr-xversion.h.cmake7
26 files changed, 269 insertions, 147 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 76739be..1a18fcd 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,37 +1,37 @@
#######
# Dlt - Diagnostic Log and Trace
-# @licence make begin@
- #
- # Copyright (C) 2011, BMW AG - Alexander Wenzel <alexander.wenzel@bmw.de>
- #
- # This program is free software; you can redistribute it and/or modify it under the terms of the
- # GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation.
- # This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- # the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
- # Public License, version 2.1, for more details.
- #
- # You should have received a copy of the GNU Lesser General Public License, version 2.1, along
- # with this program; if not, see <http://www.gnu.org/licenses/lgpl-2.1.html>.
- #
- # Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may
- # also be applicable to programs even in cases in which the program is not a library in the technical sense.
- #
- # Linking DLT statically or dynamically with other modules is making a combined work based on DLT. You may
- # license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to
- # license your linked modules under the GNU Lesser General Public License, version 2.1, you
- # may use the program under the following exception.
- #
- # As a special exception, the copyright holders of DLT give you permission to combine DLT
- # with software programs or libraries that are released under any license unless such a combination is not
- # permitted by the license of such a software program or library. You may copy and distribute such a
- # system following the terms of the GNU Lesser General Public License, version 2.1, including this
- # special exception, for DLT and the licenses of the other code concerned.
- #
- # Note that people who make modified versions of DLT are not obligated to grant this special exception
- # for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License,
- # version 2.1, gives permission to release a modified version without this exception; this exception
- # also makes it possible to release a modified version which carries forward this exception.
- #
+# @licence make begin@
+ #
+ # Copyright (C) 2011, BMW AG - Alexander Wenzel <alexander.wenzel@bmw.de>
+ #
+ # This program is free software; you can redistribute it and/or modify it under the terms of the
+ # GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation.
+ # This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
+ # the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
+ # Public License, version 2.1, for more details.
+ #
+ # You should have received a copy of the GNU Lesser General Public License, version 2.1, along
+ # with this program; if not, see <http://www.gnu.org/licenses/lgpl-2.1.html>.
+ #
+ # Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may
+ # also be applicable to programs even in cases in which the program is not a library in the technical sense.
+ #
+ # Linking DLT statically or dynamically with other modules is making a combined work based on DLT. You may
+ # license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to
+ # license your linked modules under the GNU Lesser General Public License, version 2.1, you
+ # may use the program under the following exception.
+ #
+ # As a special exception, the copyright holders of DLT give you permission to combine DLT
+ # with software programs or libraries that are released under any license unless such a combination is not
+ # permitted by the license of such a software program or library. You may copy and distribute such a
+ # system following the terms of the GNU Lesser General Public License, version 2.1, including this
+ # special exception, for DLT and the licenses of the other code concerned.
+ #
+ # Note that people who make modified versions of DLT are not obligated to grant this special exception
+ # for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License,
+ # version 2.1, gives permission to release a modified version without this exception; this exception
+ # also makes it possible to release a modified version which carries forward this exception.
+ #
# @licence end@
########
@@ -42,39 +42,54 @@ SET( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE )
PROJECT( automotive-dlt )
-# set version parameters
+# Set version parameters
SET( ${PROJECT_NAME}_MAJOR_VERSION 2 )
-SET( ${PROJECT_NAME}_MINOR_VERSION 2 )
+SET( ${PROJECT_NAME}_MINOR_VERSION 3 )
SET( ${PROJECT_NAME}_PATCH_LEVEL 0 )
-set(GENIVI_PROJECT_VERSION ${${PROJECT_NAME}_MAJOR_VERSION}.${${PROJECT_NAME}_MINOR_VERSION}.${${PROJECT_NAME}_PATCH_LEVEL})
SET( ${PROJECT_NAME}_VERSION_STATE )
-SET( ${PROJECT_NAME}_REVISION 1666 )
+SET( GENIVI_PROJECT_VERSION ${${PROJECT_NAME}_MAJOR_VERSION}.${${PROJECT_NAME}_MINOR_VERSION}.${${PROJECT_NAME}_PATCH_LEVEL})
-# Write version information into include file
SET( PRINT_MAJOR_VERSION ${${PROJECT_NAME}_MAJOR_VERSION})
SET( PRINT_MINOR_VERSION ${${PROJECT_NAME}_MINOR_VERSION})
SET( PRINT_PATCH_LEVEL ${${PROJECT_NAME}_PATCH_LEVEL})
SET( PRINT_VERSION ${GENIVI_PROJECT_VERSION})
SET( PRINT_VERSION_STATE ${${PROJECT_NAME}_VERSION_STATE})
-SET( PRINT_VERSION_REVISION ${${PROJECT_NAME}_REVISION})
-# Print version information
-MESSAGE("VERSION ${PRINT_VERSION}")
-MESSAGE("VERSION_STATE ${PRINT_VERSION_STATE}")
-MESSAGE("REVISION ${PRINT_VERSION_REVISION}")
+IF(NOT DEFINED PRINT_REVISION)
+ execute_process(COMMAND git describe --tags WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ OUTPUT_VARIABLE PRINT_REVISION
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ENDIF(NOT DEFINED PRINT_REVISION)
##################### RPM CONFIG ########################
-
-set( GENIVI_RPM_RELEASE "1${SVN_REVISION}")
+SET( GENIVI_RPM_RELEASE "1${IDLT_VERSION}")
SET( LICENSE "LGPL v2.1 with special exception" )
-set(SPEC_DIR "package")
+SET( SPEC_DIR "package")
#########################################################
-set(GENIVI_BUILDSYSTEM_AVAILABLE $ENV{GENIVI_BUILDSYSTEM})
+SET(GENIVI_BUILDSYSTEM_AVAILABLE $ENV{GENIVI_BUILDSYSTEM})
IF(GENIVI_BUILDSYSTEM_AVAILABLE)
-include($ENV{GENIVI_BUILDSYSTEM}/cmake_extensions/GeniviCMakeExtensions.cmake)
+ INCLUDE($ENV{GENIVI_BUILDSYSTEM}/cmake_extensions/GeniviCMakeExtensions.cmake)
ENDIF(GENIVI_BUILDSYSTEM_AVAILABLE)
+
+###################### GPROF Settings ###################
+# Adds compile flag for gprof to target
+# Run the binary
+# Output: gmon.out in build directory
+# Run: gprof <path/to/binary> > profile.output
+SET( GPROF_DLT_DAEMON OFF )
+SET( GPROF_DLT_LIB OFF )
+SET( GPROF_DLT_EXAMPLES OFF)
+SET( GPROF_DLT_TESTS OFF)
+SET( GPROF_DLT_CONSOLE OFF)
+SET( GPROF_DLT_ADAPTOR OFF)
+
+###################### systemd Settings #################
+SET( DLT_SYSLOG_APPID "SYS" )
+SET( DLT_SYSLOG_CTID "LOG" )
+SET( DLT_SYSLOG_PORT 4712 )
+
SET( prefix ${CMAKE_INSTALL_PREFIX})
SET( libdir "\${exec_prefix}/lib" )
SET( includedir "\${exec_prefix}/include" )
@@ -160,10 +175,11 @@ CHECK_FUNCTION_EXISTS( strstr HAVE_FUNC_STRSTR)
CHECK_FUNCTION_EXISTS( strtol HAVE_FUNC_STRTOL)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_SOURCE_DIR}/config.h @ONLY)
-CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/svnversion.h.cmake ${CMAKE_SOURCE_DIR}/svnversion.h @ONLY)
-CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/version.h.cmake ${CMAKE_SOURCE_DIR}/version.h @ONLY)
+CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/dlt/dlt_version.h.cmake ${CMAKE_SOURCE_DIR}/include/dlt/dlt_version.h @ONLY)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/doxygen.cfg.cmake ${CMAKE_SOURCE_DIR}/doxygen.cfg @ONLY)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/automotive-dlt.pc.cmake ${CMAKE_SOURCE_DIR}/automotive-dlt.pc @ONLY)
+CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/systemd/dlt.service.cmake ${CMAKE_SOURCE_DIR}/systemd/dlt.service @ONLY)
+CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/systemd/dlt-syslog.service.cmake ${CMAKE_SOURCE_DIR}/systemd/dlt-syslog.service @ONLY)
#CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/package/automotive-dlt.spec.cmake ${CMAKE_SOURCE_DIR}/package/automotive-dlt.spec ESCAPE_QUOTES)
OPTION(BUILD_SHARED_LIBS "Set to OFF to build static libraries" ON )
@@ -171,6 +187,8 @@ OPTION(ENABLE_BUILD_DOC "Set to ON to build Documentation" OFF)
MESSAGE( STATUS )
MESSAGE( STATUS "-------------------------------------------------------------------------------" )
+MESSAGE( STATUS "Build for Version ${PRINT_VERSION} build ${PRINT_REVISION}")
+MESSAGE( STATUS "VERSION_STATE ${PRINT_VERSION_STATE}")
MESSAGE( STATUS "BUILD_SHARED_LIBS = ${BUILD_SHARED_LIBS}" )
MESSAGE( STATUS "CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}" )
MESSAGE( STATUS "CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}" )
@@ -232,13 +250,9 @@ CONFIGURE_FILE(
EXPORT_LIBRARY_DEPENDENCIES( "${PROJECT_NAME}LibDeps.cmake" )
-#######################
-# CPack configuration #
-#######################
-
+################ CPack configuration #################
SET(CPACK_GENERATOR "DEB;RPM;TGZ")
-
-SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Alexander Wenzel") #required
+SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Alexander Wenzel")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "automotive-dlt")
SET(CPACK_PACKAGE_DESCRIPTION "This component provides a standardised log and trace interface, based on the
standardised protocol specified in the AUTOSAR standard 4.0 DLT.
@@ -250,7 +264,7 @@ logging facility providing
- the DLT client console utilities
- the DLT test applications ")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt")
-SET(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.txt")
+SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
SET(CPACK_PACKAGE_VERSION_MAJOR ${PRINT_MAJOR_VERSION})
SET(CPACK_PACKAGE_VERSION_MINOR ${PRINT_MINOR_VERSION})
SET(CPACK_PACKAGE_VERSION_PATCH ${PRINT_PATCH_LEVEL})
diff --git a/LIMITATIONS b/LIMITATIONS
deleted file mode 100755
index 831374e..0000000
--- a/LIMITATIONS
+++ /dev/null
@@ -1,11 +0,0 @@
-KNOWN LIMITATIONS:
-(26.07.2010)
-
-Client:
-- Only one daemon connection is supported
-
-Daemon:
-- Missing features, see TODO
-
-User:
-- Only one application, but multiple contexts, are possible in each user application
diff --git a/README.txt b/README.txt
deleted file mode 100755
index f1e7ee9..0000000
--- a/README.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-License
--------
-See file: LICENSE.txt
-The full LGPL license: LGPL.txt
diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt
index 7acb10c..f573f4e 100755
--- a/ReleaseNotes.txt
+++ b/ReleaseNotes.txt
@@ -23,6 +23,14 @@ Alexander.AW.Wenzel@bmw.de
Changes in this release
-----------------------
+2.3.0
+
+Improvements
+ * [GSW-16] Systemd configuration for syslog to DLT dapater
+ * [GSW-62] DLT Library version check
+ * [GSW-28] Directory where persistent data is stored is not configurable
+ * [GSW-46] DLT client library sets a huge stack size for internal thread
+ * [GSW-59] Statically allocated large array
2.2.0:
diff --git a/include/dlt/CMakeLists.txt b/include/dlt/CMakeLists.txt
index fcdbaea..6ddcfad 100755
--- a/include/dlt/CMakeLists.txt
+++ b/include/dlt/CMakeLists.txt
@@ -35,6 +35,6 @@
# @licence end@
########
-install(FILES dlt.h dlt_user.h dlt_user_macros.h dlt_client.h dlt_protocol.h dlt_common.h dlt_types.h
+install(FILES dlt.h dlt_user.h dlt_user_macros.h dlt_client.h dlt_protocol.h dlt_common.h dlt_types.h dlt_version.h
DESTINATION include/dlt
COMPONENT devel)
diff --git a/include/dlt/dlt_common.h b/include/dlt/dlt_common.h
index a13787b..67371be 100755
--- a/include/dlt/dlt_common.h
+++ b/include/dlt/dlt_common.h
@@ -1025,6 +1025,18 @@ extern "C"
*/
void dlt_get_version(char *buf);
+ /**
+ * Print dlt major version to buffer
+ * @param buf Pointer to buffer
+ */
+ void dlt_get_major_version(char *buf);
+
+ /**
+ * Print dlt minor version to buffer
+ * @param buf Pointer to buffer
+ */
+ void dlt_get_minor_version(char *buf);
+
#endif
/* Function prototypes which should be used only internally */
diff --git a/include/dlt/dlt_user.h b/include/dlt/dlt_user.h
index a1b6229..263a5f2 100755
--- a/include/dlt/dlt_user.h
+++ b/include/dlt/dlt_user.h
@@ -382,7 +382,7 @@ int dlt_free();
* @param description long name of the application
* @return negative value if there was an error
*/
-int dlt_register_app(const char *appid, const char * description);
+int dlt_register_app(const char *appid, const char * description, const char * user_major_version, const char * user_minor_version);
/**
* Unregister an application in the daemon.
@@ -440,6 +440,14 @@ int dlt_register_injection_callback(DltContext *handle, uint32_t service_id,
int dlt_verbose_mode(void);
/**
+ * Check the version of dlt library with library version used of the application.
+ * @param Major version number of application - see dlt_version.h
+ * @param Minor version number of application - see dlt_version.h
+ * @return negative value if there is a mismatch
+ */
+int dlt_user_check_library_version(const char *user_major_version,const char *user_minor_version);
+
+/**
* Switch to non-verbose mode
*
*/
diff --git a/include/dlt/dlt_user_macros.h b/include/dlt/dlt_user_macros.h
index 78ef66d..979026a 100755
--- a/include/dlt/dlt_user_macros.h
+++ b/include/dlt/dlt_user_macros.h
@@ -35,41 +35,40 @@
* @licence end@
*/
-
/*******************************************************************************
-** **
-** SRC-MODULE: dlt_user_macros.h **
-** **
-** TARGET : linux **
-** **
-** PROJECT : DLT **
-** **
-** AUTHOR : Alexander Wenzel Alexander.AW.Wenzel@bmw.de **
-** Markus Klein **
-** **
-** PURPOSE : **
-** **
-** REMARKS : **
-** **
-** PLATFORM DEPENDANT [yes/no]: yes **
-** **
-** TO BE CHANGED BY USER [yes/no]: no **
-** **
-*******************************************************************************/
+ ** **
+ ** SRC-MODULE: dlt_user_macros.h **
+ ** **
+ ** TARGET : linux **
+ ** **
+ ** PROJECT : DLT **
+ ** **
+ ** AUTHOR : Alexander Wenzel Alexander.AW.Wenzel@bmw.de **
+ ** Markus Klein **
+ ** **
+ ** PURPOSE : **
+ ** **
+ ** REMARKS : **
+ ** **
+ ** PLATFORM DEPENDANT [yes/no]: yes **
+ ** **
+ ** TO BE CHANGED BY USER [yes/no]: no **
+ ** **
+ *******************************************************************************/
/*******************************************************************************
-** Author Identity **
-********************************************************************************
-** **
-** Initials Name Company **
-** -------- ------------------------- ---------------------------------- **
-** aw Alexander Wenzel BMW **
-** mk Markus Klein Fraunhofer ESK **
-*******************************************************************************/
+ ** Author Identity **
+ ********************************************************************************
+ ** **
+ ** Initials Name Company **
+ ** -------- ------------------------- ---------------------------------- **
+ ** aw Alexander Wenzel BMW **
+ ** mk Markus Klein Fraunhofer ESK **
+ *******************************************************************************/
/*******************************************************************************
-** Revision Control History **
-*******************************************************************************/
+ ** Revision Control History **
+ *******************************************************************************/
/*
* $LastChangedRevision: 1515 $
@@ -82,15 +81,17 @@
#ifndef DLT_USER_MACROS_H
#define DLT_USER_MACORS_H
+#include "dlt_version.h"
+
/**
- \defgroup userapi DLT User API
- \addtogroup userapi
- \{
-*/
+ \defgroup userapi DLT User API
+ \addtogroup userapi
+ \{
+ */
/**************************************************************************************************
-* The folowing macros define a macro interface for DLT
-**************************************************************************************************/
+ * The folowing macros define a macro interface for DLT
+ **************************************************************************************************/
/**
* Create an object for a new context.
@@ -114,7 +115,8 @@ extern DltContext CONTEXT;
* @param DESCRIPTION ASCII string containing description
*/
#define DLT_REGISTER_APP(APPID,DESCRIPTION) \
- dlt_register_app( APPID, DESCRIPTION);
+ dlt_register_app( APPID, DESCRIPTION, PACKAGE_MAJOR_VERSION, PACKAGE_MINOR_VERSION );
+
/**
* Unregister application.
@@ -137,9 +139,9 @@ extern DltContext CONTEXT;
* @param CONTEXTID context id with maximal four characters
* @param DESCRIPTION ASCII string containing description
* @param LOGLEVEL log level to be pre-set for this context
- (DLT_LOG_DEFAULT is not allowed here)
+ (DLT_LOG_DEFAULT is not allowed here)
* @param TRACESTATUS trace status to be pre-set for this context
- (DLT_TRACE_STATUS_DEFAULT is not allowed here)
+ (DLT_TRACE_STATUS_DEFAULT is not allowed here)
*/
#define DLT_REGISTER_CONTEXT_LL_TS(CONTEXT,CONTEXTID,DESCRIPTION,LOGLEVEL,TRACESTATUS) \
dlt_register_context_ll_ts(&(CONTEXT), CONTEXTID, DESCRIPTION, LOGLEVEL, TRACESTATUS);
@@ -167,8 +169,8 @@ extern DltContext CONTEXT;
* @param ARGS variable list of arguments
*/
#ifdef _MSC_VER
- /* DLT_LOG is not supported by MS Visual C++ */
- /* use function interface instead */
+/* DLT_LOG is not supported by MS Visual C++ */
+/* use function interface instead */
#else
#define DLT_LOG(CONTEXT,LOGLEVEL,ARGS...) \
{ \
@@ -187,12 +189,12 @@ extern DltContext CONTEXT;
* @param LOGLEVEL the log level of the log message
* @param MSGID the message id of log message
* @param ARGS variable list of arguments:
- calls to DLT_STRING(), DLT_BOOL(), DLT_FLOAT32(), DLT_FLOAT64(),
- DLT_INT(), DLT_UINT(), DLT_RAW()
+ calls to DLT_STRING(), DLT_BOOL(), DLT_FLOAT32(), DLT_FLOAT64(),
+ DLT_INT(), DLT_UINT(), DLT_RAW()
*/
#ifdef _MSC_VER
- /* DLT_LOG_ID is not supported by MS Visual C++ */
- /* use function interface instead */
+/* DLT_LOG_ID is not supported by MS Visual C++ */
+/* use function interface instead */
#else
#define DLT_LOG_ID(CONTEXT,LOGLEVEL,MSGID,ARGS...) \
{ \
@@ -311,7 +313,6 @@ extern DltContext CONTEXT;
dlt_log_string(&(CONTEXT), LOGLEVEL, TEXT); \
}
-
/**
* Send log message with string parameter and integer parameter.
* @param CONTEXT object containing information about one special logging context
@@ -408,7 +409,7 @@ extern DltContext CONTEXT;
dlt_disable_local_print();
/**
- \}
-*/
+ \}
+ */
#endif /* DLT_USER_MACROS_H */
diff --git a/include/dlt/dlt_version.h b/include/dlt/dlt_version.h
new file mode 100755
index 0000000..c1e7b06
--- /dev/null
+++ b/include/dlt/dlt_version.h
@@ -0,0 +1,12 @@
+/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
+#ifndef __VERSION_H_
+#define __VERSION_H_
+
+#define PACKAGE_VERSION_STATE ""
+#define PACKAGE_VERSION "2.3.0"
+#define PACKAGE_MAJOR_VERSION "2"
+#define PACKAGE_MINOR_VERSION "3"
+#define PACKAGE_PATCH_LEVEL "0"
+#define PACKAGE_REVISION "v2.2.0-14-g27b7b43"
+
+#endif
diff --git a/include/dlt/dlt_version.h.cmake b/include/dlt/dlt_version.h.cmake
new file mode 100755
index 0000000..f217db3
--- /dev/null
+++ b/include/dlt/dlt_version.h.cmake
@@ -0,0 +1,12 @@
+/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
+#ifndef __VERSION_H_
+#define __VERSION_H_
+
+#define PACKAGE_VERSION_STATE "@PRINT_VERSION_STATE@"
+#define PACKAGE_VERSION "@PRINT_VERSION@"
+#define PACKAGE_MAJOR_VERSION "@PRINT_MAJOR_VERSION@"
+#define PACKAGE_MINOR_VERSION "@PRINT_MINOR_VERSION@"
+#define PACKAGE_PATCH_LEVEL "@PRINT_PATCH_LEVEL@"
+#define PACKAGE_REVISION "@PRINT_REVISION@"
+
+#endif
diff --git a/src/adaptor/CMakeLists.txt b/src/adaptor/CMakeLists.txt
index 8a04377..a07bcbb 100755
--- a/src/adaptor/CMakeLists.txt
+++ b/src/adaptor/CMakeLists.txt
@@ -37,11 +37,17 @@
set(dlt_adaptor_stdin_SRCS dlt-adaptor-stdin)
add_executable(dlt-adaptor-stdin ${dlt_adaptor_stdin_SRCS})
+IF(GPROF_DLT_ADAPTOR)
+ SET(CMAKE_C_FLAGS "-pg")
+ENDIF(GPROF_DLT_ADAPTOR)
target_link_libraries(dlt-adaptor-stdin dlt)
set_target_properties(dlt-adaptor-stdin PROPERTIES LINKER_LANGUAGE C)
set(dlt_adaptor_udp_SRCS dlt-adaptor-udp)
add_executable(dlt-adaptor-udp ${dlt_adaptor_udp_SRCS})
+IF(GPROF_DLT_ADAPTOR)
+ SET(CMAKE_C_FLAGS "-pg")
+ENDIF(GPROF_DLT_ADAPTOR)
target_link_libraries(dlt-adaptor-udp dlt)
set_target_properties(dlt-adaptor-udp PROPERTIES LINKER_LANGUAGE C)
diff --git a/src/console/CMakeLists.txt b/src/console/CMakeLists.txt
index 6cc03ac..6de6723 100755
--- a/src/console/CMakeLists.txt
+++ b/src/console/CMakeLists.txt
@@ -37,11 +37,17 @@
set(dlt_convert_SRCS dlt-convert)
add_executable(dlt-convert ${dlt_convert_SRCS} ${dlt_most_SRCS})
+IF(GPROF_DLT_CONSOLE)
+ SET(CMAKE_C_FLAGS "-pg")
+ENDIF(GPROF_DLT_CONSOLE)
target_link_libraries(dlt-convert dlt ${EXPAT_LIBRARIES})
set_target_properties(dlt-convert PROPERTIES LINKER_LANGUAGE C)
set(dlt_receive_SRCS dlt-receive)
add_executable(dlt-receive ${dlt_receive_SRCS} ${dlt_most_SRCS})
+IF(GPROF_DLT_CONSOLE)
+ SET(CMAKE_C_FLAGS "-pg")
+ENDIF(GPROF_DLT_CONSOLE)
target_link_libraries(dlt-receive dlt ${EXPAT_LIBRARIES})
set_target_properties(dlt-receive PROPERTIES LINKER_LANGUAGE C)
diff --git a/src/daemon/CMakeLists.txt b/src/daemon/CMakeLists.txt
index 863036b..c9f0162 100755
--- a/src/daemon/CMakeLists.txt
+++ b/src/daemon/CMakeLists.txt
@@ -37,6 +37,9 @@
set(dlt_daemon_SRCS dlt-daemon dlt_daemon_common ${CMAKE_SOURCE_DIR}/src/shared/dlt_user_shared.c ${CMAKE_SOURCE_DIR}/src/shared/dlt_common.c)
add_executable(dlt-daemon ${dlt_daemon_SRCS})
+IF(GPROF_DLT_DAEMON)
+ SET(CMAKE_C_FLAGS "-pg")
+ENDIF(GPROF_DLT_DAEMON)
target_link_libraries(dlt-daemon rt ${CMAKE_THREAD_LIBS_INIT})
install(TARGETS dlt-daemon
diff --git a/src/daemon/dlt-daemon.c b/src/daemon/dlt-daemon.c
index 2438368..4f30a86 100755
--- a/src/daemon/dlt-daemon.c
+++ b/src/daemon/dlt-daemon.c
@@ -98,9 +98,6 @@
#include <sys/time.h>
#include <linux/stat.h>
-#include "version.h"
-#include "svnversion.h"
-
#include "dlt_types.h"
#include "dlt-daemon.h"
#include "dlt-daemon_cfg.h"
diff --git a/src/examples/CMakeLists.txt b/src/examples/CMakeLists.txt
index cb6fbb2..6ea331d 100755
--- a/src/examples/CMakeLists.txt
+++ b/src/examples/CMakeLists.txt
@@ -37,11 +37,17 @@
set(dlt_example_user_SRCS dlt-example-user)
add_executable(dlt-example-user ${dlt_example_user_SRCS})
+IF(GPROF_DLT_EXAMPLES)
+ SET(CMAKE_C_FLAGS "-pg")
+ENDIF(GPROF_DLT_EXAMPLES)
target_link_libraries(dlt-example-user dlt)
set_target_properties(dlt-example-user PROPERTIES LINKER_LANGUAGE C)
set(dlt_example_user_func_SRCS dlt-example-user-func)
add_executable(dlt-example-user-func ${dlt_example_user_func_SRCS})
+IF(GPROF_DLT_EXAMPLES)
+ SET(CMAKE_C_FLAGS "-pg")
+ENDIF(GPROF_DLT_EXAMPLES)
target_link_libraries(dlt-example-user-func dlt)
set_target_properties(dlt-example-user-func PROPERTIES LINKER_LANGUAGE C)
diff --git a/src/examples/dlt-example-user-func.c b/src/examples/dlt-example-user-func.c
index 2180a6b..8939f1b 100755
--- a/src/examples/dlt-example-user-func.c
+++ b/src/examples/dlt-example-user-func.c
@@ -217,7 +217,7 @@ int main(int argc, char* argv[])
}
}
- dlt_register_app("LOG","Test Application for Logging");
+ dlt_register_app("LOG","Test Application for Logging", PACKAGE_MAJOR_VERSION,PACKAGE_MINOR_VERSION);
dlt_register_context(&mycontext,"TEST","Test Context for Logging");
diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt
index 2ad8ce5..8e81cfb 100755
--- a/src/lib/CMakeLists.txt
+++ b/src/lib/CMakeLists.txt
@@ -39,9 +39,13 @@ set(dlt_LIB_SRCS dlt_user dlt_client ${CMAKE_SOURCE_DIR}/src/shared/dlt_common.c
add_library(dlt ${dlt_LIB_SRCS})
+IF(GPROF_DLT_LIB)
+ SET(CMAKE_C_FLAGS "-pg")
+ENDIF(GPROF_DLT_LIB)
+
target_link_libraries(dlt rt ${CMAKE_THREAD_LIBS_INIT})
-set_target_properties(dlt PROPERTIES VERSION 2.2.0 SOVERSION 2)
+set_target_properties(dlt PROPERTIES VERSION 2.3.0 SOVERSION 2)
install(TARGETS dlt
LIBRARY DESTINATION lib
diff --git a/src/lib/dlt_user.c b/src/lib/dlt_user.c
index 26aa3e0..0764efc 100755
--- a/src/lib/dlt_user.c
+++ b/src/lib/dlt_user.c
@@ -124,6 +124,24 @@ static int dlt_user_log_check_user_message(void);
static void dlt_user_log_reattach_to_daemon(void);
static int dlt_user_log_send_overflow(void);
+int dlt_user_check_library_version(const char *user_major_version,const char *user_minor_version){
+
+ char str[200];
+ char lib_major_version[DLT_USER_MAX_LIB_VERSION_LENGTH];
+ char lib_minor_version[DLT_USER_MAX_LIB_VERSION_LENGTH];
+
+ dlt_get_major_version( lib_major_version);
+ dlt_get_minor_version( lib_minor_version);
+
+ if( (strcmp(lib_major_version,user_major_version)!=0) || (strcmp(lib_minor_version,user_minor_version)!=0))
+ {
+ sprintf(str,"DLT Library version check failed! Installed DLT library version is %s.%s - Application using DLT library version %s.%s\n",lib_major_version,lib_minor_version,user_major_version,user_minor_version);
+ dlt_log(LOG_WARNING, str);
+ return -1;
+ }
+ return 0;
+}
+
int dlt_init(void)
{
char filename[DLT_USER_MAX_FILENAME_LENGTH];
@@ -372,7 +390,7 @@ int dlt_free(void)
-int dlt_register_app(const char *appid, const char * description)
+int dlt_register_app(const char *appid, const char * description, const char * user_major_version,const char * user_minor_version)
{
int ret;
@@ -382,6 +400,8 @@ int dlt_register_app(const char *appid, const char * description)
{
return -1;
}
+
+ dlt_user_check_library_version(user_major_version, user_minor_version);
}
if ((appid==0) || (appid[0]=='\0'))
diff --git a/src/lib/dlt_user_cfg.h b/src/lib/dlt_user_cfg.h
index 4376587..31af24d 100755
--- a/src/lib/dlt_user_cfg.h
+++ b/src/lib/dlt_user_cfg.h
@@ -100,6 +100,9 @@
/* Maximu length of a filename string */
#define DLT_USER_MAX_FILENAME_LENGTH 255
+/* Maximum length of a single version number */
+#define DLT_USER_MAX_LIB_VERSION_LENGTH 3
+
/* Length of buffer for constructing text output */
#define DLT_USER_TEXT_LENGTH 10024
diff --git a/src/shared/dlt_common.c b/src/shared/dlt_common.c
index 0533c0e..4ac7dbe 100755
--- a/src/shared/dlt_common.c
+++ b/src/shared/dlt_common.c
@@ -86,8 +86,7 @@
#include "dlt_common.h"
#include "dlt_common_cfg.h"
-#include "version.h"
-#include "svnversion.h"
+#include "dlt_version.h"
#if defined (__WIN32__) || defined (_MSC_VER)
#include <winsock2.h> /* for socket(), connect(), send(), and recv() */
@@ -2947,9 +2946,20 @@ speed_t dlt_convert_serial_speed(int baudrate)
void dlt_get_version(char *buf)
{
sprintf(buf,"DLT Package Version: %s %s, Package Revision: %s, build on %s %s\n",
- PACKAGE_VERSION, PACKAGE_VERSION_STATE, SVN_VERSION, __DATE__ , __TIME__ );
+ PACKAGE_VERSION, PACKAGE_VERSION_STATE, PACKAGE_REVISION, __DATE__ , __TIME__ );
}
+void dlt_get_major_version(char *buf)
+{
+ sprintf(buf,"%s",PACKAGE_MAJOR_VERSION);
+}
+
+void dlt_get_minor_version(char *buf)
+{
+ sprintf(buf,"%s",PACKAGE_MINOR_VERSION);
+}
+
+
uint32_t dlt_uptime(void)
{
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
index 6eb708d..691f1f0 100755
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -37,21 +37,33 @@
set(dlt_test_user_SRCS dlt-test-user)
add_executable(dlt-test-user ${dlt_test_user_SRCS})
+IF(GPROF_DLT_TESTS)
+ SET(CMAKE_C_FLAGS "-pg")
+ENDIF(GPROF_DLT_TESTS)
target_link_libraries(dlt-test-user dlt)
set_target_properties(dlt-test-user PROPERTIES LINKER_LANGUAGE C)
set(dlt_test_client_SRCS dlt-test-client)
add_executable(dlt-test-client ${dlt_test_client_SRCS})
+IF(GPROF_DLT_TESTS)
+ SET(CMAKE_C_FLAGS "-pg")
+ENDIF(GPROF_DLT_TESTS)
target_link_libraries(dlt-test-client dlt)
set_target_properties(dlt-test-client PROPERTIES LINKER_LANGUAGE C)
set(dlt_test_stress_SRCS dlt-test-stress)
add_executable(dlt-test-stress ${dlt_test_stress_SRCS})
+IF(GPROF_DLT_TESTS)
+ SET(CMAKE_C_FLAGS "-pg")
+ENDIF(GPROF_DLT_TESTS)
target_link_libraries(dlt-test-stress dlt)
set_target_properties(dlt-test-stress PROPERTIES LINKER_LANGUAGE C)
set(dlt_test_internal_SRCS dlt-test-internal)
add_executable(dlt-test-internal ${dlt_test_internal_SRCS})
+IF(GPROF_DLT_TESTS)
+ SET(CMAKE_C_FLAGS "-pg")
+ENDIF(GPROF_DLT_TESTS)
target_link_libraries(dlt-test-internal dlt)
set_target_properties(dlt-test-internal PROPERTIES LINKER_LANGUAGE C)
diff --git a/svnversion.h.cmake b/svnversion.h.cmake
deleted file mode 100755
index d95074f..0000000
--- a/svnversion.h.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
-#define SVN_VERSION "@PRINT_VERSION_REVISION@"
diff --git a/systemd/dlt-syslog.service.cmake b/systemd/dlt-syslog.service.cmake
new file mode 100755
index 0000000..6f4db32
--- /dev/null
+++ b/systemd/dlt-syslog.service.cmake
@@ -0,0 +1,18 @@
+# This file is for starting dlt-adaptor-udp
+#
+# For more informations about starting options of dlt-daemon use the command "dlt-adaptor-udp -h".
+#
+# basic.target A special target unit covering early boot-up.
+# Usually this should pull-in all sockets, mount points, swap devices and
+# other basic initialization necessary for the general purpose daemons.
+# Most normal daemons should have dependencies of type After and Requires on this unit
+
+[Unit]
+Description=DLT Syslog Adapter
+
+[Service]
+ExecStart=/usr/local/bin/dlt-adaptor-udp -a @DLT_SYSLOG_APPID@ -c @DLT_SYSLOG_CTID@ -p @DLT_SYSLOG_PORT@
+# Restart=always
+
+[Install]
+WantedBy=basic.target
diff --git a/systemd/dlt.service b/systemd/dlt.service.cmake
index 5bee126..357366a 100755
--- a/systemd/dlt.service
+++ b/systemd/dlt.service.cmake
@@ -5,6 +5,7 @@
#
# Multi-user.target is a special target unit for setting up a multi-user system (non-graphical).
# For more details about the multi-user.target see systemd.special(7).
+
[Unit]
Description=DLT Daemon for logging and tracing
@@ -13,4 +14,4 @@ ExecStart=/usr/local/bin/dlt-daemon -r
#Restart=always
[Install]
-WantedBy=multi-user.target \ No newline at end of file
+WantedBy=multi-user.target
diff --git a/version.h b/version.h
deleted file mode 100755
index 776199f..0000000
--- a/version.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef __VERSION_H_
-#define __VERSION_H_
-
-#define PACKAGE_VERSION_STATE ""
-#define PACKAGE_VERSION "2.2.0"
-
-#endif
diff --git a/version.h.cmake b/version.h.cmake
deleted file mode 100755
index d4fea8a..0000000
--- a/version.h.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef __VERSION_H_
-#define __VERSION_H_
-
-#define PACKAGE_VERSION_STATE "@PRINT_VERSION_STATE@"
-#define PACKAGE_VERSION "@PRINT_VERSION@"
-
-#endif