/* * @licence app begin@ * SPDX license identifier: MPL-2.0 * * Copyright (C) 2011-2015, BMW AG * * This file is part of GENIVI Project DLT - Diagnostic Log and Trace. * * This Source Code Form is subject to the terms of the * Mozilla Public License (MPL), v. 2.0. * If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. * * For further information see http://www.genivi.org/. * @licence end@ */ /*! * \author Alexander Wenzel * * \copyright Copyright © 2011-2015 BMW AG. \n * License MPL-2.0: Mozilla Public License version 2.0 http://mozilla.org/MPL/2.0/. * * \file dlt-test-stress.c */ /******************************************************************************* ** ** ** SRC-MODULE: dlt-test-stress.c ** ** ** ** 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 ** *******************************************************************************/ /******************************************************************************* ** Revision Control History ** *******************************************************************************/ /* * $LastChangedRevision: 1670 $ * $LastChangedDate: 2011-04-08 15:12:06 +0200 (Fr, 08. Apr 2011) $ * $LastChangedBy$ Initials Date Comment aw 13.01.2010 initial */ #include #include /* for isprint() */ #include #include /* for printf() and fprintf() */ #include /* for atoi() and exit() */ #include /* for memset() */ #include /* for close() */ #include /* POSIX Threads */ #include "dlt.h" #include "dlt_common.h" /* for dlt_get_version() */ DltContext mycontext[9999]; typedef struct { int num; } thread_data_t; #define STRESS1_NUM_CONTEXTS 3000 #define STRESS2_MAX_NUM_THREADS 64 #define STRESS3_MAX_NUM_MESSAGES 512 #define MAX_TESTS 3 void stress1(void); void stress2(void); void thread_function(void); void stress3(void); /** * Print usage information of tool. */ void usage() { char version[255]; dlt_get_version(version,255); printf("Usage: dlt-test-stress [options]\n"); printf("Test application executing several stress tests.\n"); printf("%s \n", version); printf("Options:\n"); printf(" -v Verbose mode\n"); printf(" -f filename Use local log file instead of sending to daemon\n"); printf(" -1 Execute test 1 (register/unregister many contexts)\n"); printf(" -2 Execute test 2 (multiple threads logging data)\n"); printf(" -3 Execute test 3 (logging much data)\n"); } /** * Main function of tool. */ int main(int argc, char* argv[]) { //int vflag = 0; char *fvalue = 0; int test[MAX_TESTS]; int i,c,help; for (i=0;i