Skip to content

Commit ac11e01

Browse files
authored
Merge pull request #41 from annatisch/debug
CPU load improvements
2 parents f825094 + 539301e commit ac11e01

File tree

238 files changed

+7796
-7336
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

238 files changed

+7796
-7336
lines changed

HISTORY.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
Release History
44
===============
55

6+
1.0.3 (2018-09-14)
7+
++++++++++++++++++
8+
9+
- Reduced CPU load during idle receive.
10+
- Updated Azure uAMQP C and Azure C Shared Utility dependencies.
11+
12+
613
1.0.2 (2018-09-05)
714
++++++++++++++++++
815

build_many_linux_32bit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -e
44
# To execute this script:
55
# docker run --rm -v $PWD:/data local/manylinux_crypto32 /data/build_many_linux_32bit.sh
66

7-
export UAMQP_VERSION="1.0.2"
7+
export UAMQP_VERSION="1.0.3"
88

99
export CPATH="/opt/pyca/cryptography/openssl/include"
1010
export LIBRARY_PATH="/opt/pyca/cryptography/openssl/lib"

build_many_linux_64bit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -e
44
# To execute this script:
55
# docker run --rm -v $PWD:/data local/manylinux_crypto64 /data/build_many_linux_64bit.sh
66

7-
export UAMQP_VERSION="1.0.2"
7+
export UAMQP_VERSION="1.0.3"
88

99
export CPATH="/opt/pyca/cryptography/openssl/include"
1010
export LIBRARY_PATH="/opt/pyca/cryptography/openssl/lib"

src/vendor/azure-uamqp-c/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ if(NOT ${use_installed_dependencies})
4141
if (NOT TARGET umock_c)
4242
add_subdirectory(deps/umock-c)
4343
endif()
44-
endif()
44+
endif()
4545
if (NOT TARGET aziotsharedutil)
4646
add_subdirectory(deps/azure-c-shared-utility)
4747
endif()
@@ -228,7 +228,7 @@ target_link_libraries(uamqp aziotsharedutil)
228228
if (NOT ${skip_samples})
229229
add_subdirectory(samples)
230230
endif()
231-
231+
232232
if (${run_unittests})
233233
include("dependencies-test.cmake")
234234
add_subdirectory(tests)
@@ -289,8 +289,8 @@ else()
289289
uamqp
290290
)
291291
install(FILES ${uamqp_h_files}
292-
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/azure_uamqp_c)
293-
install(TARGETS ${install_staticlibs}
292+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/azure_uamqp_c)
293+
install(TARGETS ${install_staticlibs}
294294
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
295295
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
296296
endif()

src/vendor/azure-uamqp-c/deps/azure-c-shared-utility/CMakeLists.txt

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ else()
4747
else()
4848
option(use_openssl "set use_openssl to ON if openssl is to be used, set to OFF to not use openssl" ON)
4949
option(use_socketio "set use_socketio to ON if socketio is to be included in the library, set to OFF if a different implementation will be provided" ON)
50-
endif()
50+
endif()
5151
option(use_wolfssl "set use_wolfssl to ON if wolfssl is to be used, set to OFF to not use wolfssl" OFF)
5252
endif()
5353

@@ -65,12 +65,12 @@ if (MACOSX)
6565
endif()
6666
endif()
6767

68-
if(${use_etw})
68+
if(${use_etw})
6969
#create res folder
7070
file(MAKE_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/res)
71-
71+
7272
#populate res folder with the ETW resources
73-
execute_process(COMMAND ${CMAKE_CURRENT_LIST_DIR}/src/etw_provider_generate.cmd
73+
execute_process(COMMAND ${CMAKE_CURRENT_LIST_DIR}/src/etw_provider_generate.cmd
7474
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/src
7575
)
7676
endif()
@@ -87,7 +87,11 @@ if(${use_openssl})
8787
set(OPENSSL_ROOT_DIR $ENV{OpenSSLDir} CACHE PATH "")
8888
endif()
8989

90-
find_package(OpenSSL REQUIRED)
90+
# If OpenSSL::SSL OR OpenSSL::Crypto are not set then you need to run
91+
# the find package for openssl
92+
if (NOT TARGET OpenSSL::SSL OR NOT TARGET OpenSSL::Crypto OR NOT ${OPENSSL_INCLUDE_DIR})
93+
find_package(OpenSSL REQUIRED)
94+
endif()
9195
include_directories(${OPENSSL_INCLUDE_DIR})
9296
endif()
9397

@@ -124,6 +128,10 @@ if(MSVC)
124128
if(${use_wolfssl})
125129
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_WOLFSSL")
126130
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_WOLFSSL")
131+
132+
# Disables error if a bit-field is used on non-integer variable
133+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /wd4214")
134+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4 /wd4214")
127135
endif()
128136

129137
endif()
@@ -255,6 +263,7 @@ set(source_h_files
255263
./inc/azure_c_shared_utility/const_defines.h
256264
${LOGGING_H_FILE}
257265
./inc/azure_c_shared_utility/doublylinkedlist.h
266+
./inc/azure_c_shared_utility/envvariable.h
258267
./inc/azure_c_shared_utility/gballoc.h
259268
./inc/azure_c_shared_utility/gbnetwork.h
260269
./inc/azure_c_shared_utility/gb_stdio.h
@@ -280,6 +289,7 @@ ${LOGGING_H_FILE}
280289
./inc/azure_c_shared_utility/strings_types.h
281290
./inc/azure_c_shared_utility/string_tokenizer.h
282291
./inc/azure_c_shared_utility/string_tokenizer_types.h
292+
./inc/azure_c_shared_utility/tlsio_options.h
283293
./inc/azure_c_shared_utility/tickcounter.h
284294
./inc/azure_c_shared_utility/threadapi.h
285295
./inc/azure_c_shared_utility/xio.h
@@ -374,9 +384,25 @@ endif()
374384

375385

376386
if(${build_as_dynamic})
387+
388+
# need to create a def file from existing def files due to cmake
389+
# not letting us build more than one file
390+
file(READ ./src/aziotsharedutil.def DEF_FILE_CONTENT)
391+
file(WRITE "${CMAKE_BINARY_DIR}/shared_util.def" ${DEF_FILE_CONTENT})
392+
file(READ ./src/aziotsharedutil_http.def DEF_FILE_CONTENT)
393+
file(APPEND "${CMAKE_BINARY_DIR}/shared_util.def" ${DEF_FILE_CONTENT})
394+
file(READ ./src/aziotsharedutil_wsio.def DEF_FILE_CONTENT)
395+
file(APPEND "${CMAKE_BINARY_DIR}/shared_util.def" ${DEF_FILE_CONTENT})
396+
397+
set(def_files "${CMAKE_BINARY_DIR}/shared_util.def")
398+
377399
#make sure we can link as dll/so
378-
add_library(aziotsharedutil_dll SHARED ./src/aziotsharedutil.def ${source_c_files} ${source_h_files})
379-
set_target_properties(aziotsharedutil_dll PROPERTIES OUTPUT_NAME "aziotsharedutil")
400+
add_library(aziotsharedutil_dll SHARED
401+
${source_c_files}
402+
${source_h_files}
403+
${def_files}
404+
)
405+
set_target_properties(aziotsharedutil_dll PROPERTIES OUTPUT_NAME "aziotsharedutil_dll")
380406
endif()
381407

382408
set(aziotsharedutil_target_libs)
@@ -534,13 +560,13 @@ if(${use_installed_dependencies})
534560

535561
# Install Azure C Shared Utility
536562
set(package_location "cmake")
537-
563+
538564
if(${build_as_dynamic})
539565
set(targets aziotsharedutil aziotsharedutil_dll)
540566
else(${build_as_dynamic})
541567
set(targets aziotsharedutil)
542568
endif(${build_as_dynamic})
543-
569+
544570
install (TARGETS ${targets} EXPORT aziotsharedutilTargets
545571
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
546572
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
@@ -582,8 +608,8 @@ else()
582608
aziotsharedutil
583609
)
584610
install(FILES ${source_h_files}
585-
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/azure_c_shared_utility)
586-
install(TARGETS ${install_staticlibs}
611+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/azure_c_shared_utility)
612+
install(TARGETS ${install_staticlibs}
587613
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
588614
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
589615
endif()

src/vendor/azure-uamqp-c/deps/azure-c-shared-utility/adapters/agenttime_esp8266.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ time_t get_time(time_t* currentTime)
1212
}
1313

1414
double get_difftime(time_t stopTime, time_t startTime)
15-
{
15+
{
1616
return (double)stopTime - (double)startTime;
1717
}
1818

src/vendor/azure-uamqp-c/deps/azure-c-shared-utility/adapters/agenttime_mbed.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "azure_c_shared_utility/agenttime.h"
55

66
// mbed version of gmtime() returns NULL.
7-
// system RTC should be set to UTC as its localtime
7+
// system RTC should be set to UTC as its localtime
88

99
time_t get_time(time_t* currentTime)
1010
{

src/vendor/azure-uamqp-c/deps/azure-c-shared-utility/adapters/condition_pthreads.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ void Condition_Deinit(COND_HANDLE handle)
130130
// Codes_SRS_CONDITION_18_007: [ Condition_Deinit will not fail if handle is NULL ]
131131
if (handle != NULL)
132132
{
133-
// Codes_SRS_CONDITION_18_009: [ Condition_Deinit will deallocate handle if it is not NULL
133+
// Codes_SRS_CONDITION_18_009: [ Condition_Deinit will deallocate handle if it is not NULL
134134
pthread_cond_t* cond = (pthread_cond_t*)handle;
135135
pthread_cond_destroy(cond);
136136
free(cond);

src/vendor/azure-uamqp-c/deps/azure-c-shared-utility/adapters/condition_win32.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ COND_RESULT Condition_Wait(COND_HANDLE handle, LOCK_HANDLE lock, int timeout_mil
9696

9797
/* Increment the waiting thread count, unlock the lock and wait */
9898
(void)InterlockedIncrement(&cond->waiting_thread_count);
99-
99+
100100
// Codes_SRS_CONDITION_18_013: [ Condition_Wait shall accept relative timeouts ]
101101
wait_result = WaitForSingleObject(cond->event_handle, timeout_milliseconds == 0 ? INFINITE : timeout_milliseconds);
102102

@@ -141,7 +141,7 @@ COND_RESULT Condition_Wait(COND_HANDLE handle, LOCK_HANDLE lock, int timeout_mil
141141
void Condition_Deinit(COND_HANDLE handle)
142142
{
143143
// Codes_SRS_CONDITION_18_007: [ Condition_Deinit will not fail if handle is NULL ]
144-
// Codes_SRS_CONDITION_18_009: [ Condition_Deinit will deallocate handle if it is not NULL
144+
// Codes_SRS_CONDITION_18_009: [ Condition_Deinit will deallocate handle if it is not NULL
145145
if (handle != NULL)
146146
{
147147
CONDITION* cond = (CONDITION*)handle;

src/vendor/azure-uamqp-c/deps/azure-c-shared-utility/adapters/envvariable.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Copyright (c) Microsoft. All rights reserved.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4-
#include <stdlib.h>
5-
#include <stdio.h>
4+
#include <stdlib.h>
5+
#include <stdio.h>
66

77
#include "azure_c_shared_utility/envvariable.h"
88

0 commit comments

Comments
 (0)