Skip to content

Commit

Permalink
Merge pull request #3 from szmyd/master
Browse files Browse the repository at this point in the history
More github.com related changes.
  • Loading branch information
szmyd authored Dec 7, 2022
2 parents 10c2f97 + 2794ec5 commit ea63aa6
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 11 deletions.
18 changes: 9 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### None

## [2.2.1]
### Changed
- Use Folly library for map concurrency versus std::mutex.
### Added

### Fixed

## [8.6.13] - 2022-12-07

## [2.2.0]
### Changed
- Changed how threads are shutdown fixing many memory leaks.

[Unreleased]: https://github.corp.ebay.com/SDS/iomgr/compare/testing/v2.x...develop
[2.2.1]: https://github.corp.ebay.com/SDS/iomgr/compare/v2.2.0...v2.2.1
[2.2.0]: https://github.corp.ebay.com/SDS/iomgr/compare/5822b12...v2.2.0
- Moved IOManager code to github.com; start Changelog

[Unreleased]: https://github.com/eBay/IOManager/compare/v8.6.13...HEAD
[8.6.13]: https://github.com/eBay/IOManager/compare/1cbed5e...v8.6.13
5 changes: 3 additions & 2 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ def build(self):

def package(self):
copy(self, "LICENSE", self.source_folder, join(self.package_folder, "licenses"), keep_path=False)
copy(self, "*.h", join(self.source_folder, "src"), join(self.package_folder, "include", "iomgr"), keep_path=False)
copy(self, "*.hpp", join(self.source_folder, "src"), join(self.package_folder, "include", "iomgr"), keep_path=False)
copy(self, "*.h", join(self.source_folder, "src", "include"), join(self.package_folder, "include", "iomgr"), keep_path=True)
copy(self, "*.hpp", join(self.source_folder, "src", "include"), join(self.package_folder, "include", "iomgr"), keep_path=True)
copy(self, "*iomgr_config_generated.h", join(self.build_folder, "src"), join(self.package_folder, "include", "iomgr"), keep_path=False)
copy(self, "*.a", self.build_folder, join(self.package_folder, "lib"), keep_path=False)
copy(self, "*.so", self.build_folder, join(self.package_folder, "lib"), keep_path=False)
copy(self, "*.dylib", self.build_folder, join(self.package_folder, "lib"), keep_path=False)
Expand Down
19 changes: 19 additions & 0 deletions test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
cmake_minimum_required(VERSION 3.11)
project(test_package LANGUAGES CXX)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)

set(CMAKE_CXX_STANDARD 17)
find_package (Threads REQUIRED)
find_package (iomgr REQUIRED)

link_directories(${spdk_LIB_DIRS} ${dpdk_LIB_DIRS})

add_executable(test_package)
target_sources(test_package PRIVATE test_package.cpp)
target_link_libraries(test_package
iomgr::iomgr
${spdk_LIBRARY_LIST}
${dpdk_LIBRARY_LIST}
)
18 changes: 18 additions & 0 deletions test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import os
from conan import ConanFile
from conans import CMake
from conan.tools.build import cross_building

class TestPackageConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake", "cmake_find_package"

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def test(self):
if not cross_building(self):
bin_path = os.path.join("bin", "test_package")
self.run(f"{bin_path} -c -h", run_environment=True)
39 changes: 39 additions & 0 deletions test_package/test_package.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#include <boost/uuid/random_generator.hpp>
#include <boost/uuid/uuid_io.hpp>
#include <condition_variable>
#include <mutex>

/* Facility headers */
#include <sisl/logging/logging.h>
#include <sisl/options/options.h>

/* IOPath */
#include <iomgr/io_environment.hpp>

SISL_OPTION_GROUP(test_hs_vol,
(io_threads, "", "io_threads", "Number of IO threads",
cxxopts::value<uint32_t>()->default_value("1"), "count"))

#define ENABLED_OPTIONS logging, iomgr, test_hs_vol, config
#define SPDK_LOG_MODS IOMGR_LOG_MODS, flip

SISL_OPTIONS_ENABLE(ENABLED_OPTIONS)
SISL_LOGGING_INIT(SPDK_LOG_MODS)

constexpr size_t Ki = 1024;
constexpr size_t Mi = Ki * Ki;
constexpr size_t Gi = Ki * Mi;

int main(int argc, char* argv[]) {
SISL_OPTIONS_LOAD(argc, argv, ENABLED_OPTIONS)
sisl::logging::SetLogger("spdk_volume");
sisl::logging::install_crash_handler();
spdlog::set_pattern("[%D %T.%e] [%^%l%$] [%t] %v");

// Start the IOManager
ioenvironment.with_iomgr(SISL_OPTIONS["io_threads"].as<uint32_t>(), true);

iomanager.stop();
LOGINFO("Done.");
return 0;
}

0 comments on commit ea63aa6

Please sign in to comment.