{"id":16237556,"url":"https://github.com/lexus2k/uprofiler","last_synced_at":"2025-04-08T08:46:16.702Z","repository":{"id":226948920,"uuid":"770028923","full_name":"lexus2k/uprofiler","owner":"lexus2k","description":"Micro profiler","archived":false,"fork":false,"pushed_at":"2024-05-05T12:33:27.000Z","size":53,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-14T05:43:09.196Z","etag":null,"topics":["collection","microcontroller","profiler","profiler-data","profiling"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lexus2k.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-10T18:13:23.000Z","updated_at":"2024-10-03T21:16:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"d242815d-6aa7-480d-8041-7c7eabf550aa","html_url":"https://github.com/lexus2k/uprofiler","commit_stats":null,"previous_names":["lexus2k/uprofiler"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lexus2k%2Fuprofiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lexus2k%2Fuprofiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lexus2k%2Fuprofiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lexus2k%2Fuprofiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lexus2k","download_url":"https://codeload.github.com/lexus2k/uprofiler/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247808860,"owners_count":20999801,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["collection","microcontroller","profiler","profiler-data","profiling"],"created_at":"2024-10-10T13:36:08.207Z","updated_at":"2025-04-08T08:46:16.680Z","avatar_url":"https://github.com/lexus2k.png","language":"C","funding_links":["https://www.paypal.me/lexus2k"],"categories":[],"sub_categories":[],"readme":"# uProfiler\n\n\u003c!-- [![Build Status](https://circleci.com/gh/lexus2k/uprofiler.svg?style=svg)](https://circleci.com/gh/lexus2k/uprofiler) --\u003e\n![Github actions](https://github.com/lexus2k/uprofiler/actions/workflows/main.yml/badge.svg)\n[![Coverage Status](https://coveralls.io/repos/github/lexus2k/uprofiler/badge.svg?branch=main)](https://coveralls.io/github/lexus2k/uprofiler?branch=main)\n[![Documentation](https://codedocs.xyz/lexus2k/uprofiler.svg)](https://codedocs.xyz/lexus2k/uprofiler/)\n![License](https://img.shields.io/badge/license-GPLv3-blue)\n![License](https://img.shields.io/badge/license-Commercial-blue)\n\n\n[tocstart]: # (toc start)\n\n  * [Introduction](#introduction)\n  * [Key Features](#key-features)\n  * [Easy to use](#easy-to-use)\n  * [Setting up](#setting-up)\n  * [How to buid](#how-to-build)\n  * [License](#license)\n\n[tocend]: # (toc end)\n\n## Introduction\n\nuProfiler is a lightweight and efficient library designed for profiling applications, with a focus on microcontrollers commonly found in production devices. The primary objective of uProfiler is to gather valuable statistics from a fleet of devices. The library offers support for both single-threaded and multi-threaded modes, making it adaptable to various application architectures. Notably, uProfiler is lock-free, enabling its usage in interrupt handlers.\n\n\n## Key Features\n\nKey features:\n\n * Lock-free design: uProfiler is built with a lock-free architecture, ensuring that it can operate seamlessly in multi-threaded and interrupt-handling scenarios. This design choice minimizes the impact on the overall system performance and eliminates the possibility of contention issues.\n\n * Small footprint: Designed with resource-constrained environments in mind, uProfiler has a small memory and code footprint. It minimizes the utilization of system resources, making it ideal for deployment on microcontrollers with limited storage and processing capabilities.\n\n\n## Easy to use\n\n### C\n\nUsage of light uProfiler in C++ can look like this:\n```.cpp\n#include \"uprofiler.h\"\n\nvoid my_function_to_profile(void)\n{\n    uprof_begin_tag(1);\n    std::this_thread::sleep_for(std::chrono::milliseconds(100));\n    uprof_end_tag(1);\n}\n\nstatic uint32_t my_get_time()\n{\n    // for Arduino\n    return millis();\n    // For C++ applications \n    // return std::chrono::duration_cast\u003cstd::chrono::milliseconds\u003e(\n    //    std::chrono::steady_clock::now().time_since_epoch()).count();\n}\n\n...\n    uprof_config_t config = \n    {\n        .logger_output = NULL,\n        .on_buffer_ready = NULL,\n        .get_time = my_get_time\n    };\n    uint8_t buffer[uprof_calculate_size(10)];\n    uprof_init(\u0026config, buffer, sizeof(buffer));\n\n    my_function_to_profile();\n    my_function_to_profile();\n\n    uprof_tag_stat_t stat;\n    if ( uprof_get_stat(1, \u0026stat) == 0)\n    {\n        // print the stats here\n    }\n```\n\n## How to build\n\n### Linux\n```.txt\nmake\n# === OR ===\nmkdir build\ncd build\ncmake ..\nmake\n```\n\n### Windows\n```.txt\nmkdir build\ncd build\ncmake -G \"Visual Studio 16 2019\" ..\n```\n\n### ESP32\nJust place the library to your project components folder.\n\n## Setting up\n\n * Arduino Option 1 (with docs and tools)\n   * Download source from https://github.com/lexus2k/uprofiler\n   * Put the downloaded library content to Arduino/libraries/uprofiler folder\n   * Restart the Arduino IDE\n\n * ESP32 IDF\n   * Download sources from https://github.com/lexus2k/uprofiler and put to components\n     folder of your project\n   * Run `make` for your project\n\n * Linux\n   * Download sources from https://github.com/lexus2k/uprofiler\n   * Run `make` command from uprofiler folder, and it will build library and tools for you\n\n * Plain AVR\n   * Download sources from https://github.com/lexus2k/uprofiler\n   * Install avr gcc compilers\n   * Run `make ARCH=avr`\n\nFor more information about this library, please, visit https://github.com/lexus2k/uprofiler.\nDoxygen documentation can be found at [Codedocs xyz site](https://codedocs.xyz/lexus2k/uprofiler).\nIf you found any problem or have any idea, please, report to Issues section.\nIf you find the library useful and want to [support future development](https://www.paypal.me/lexus2k), you may contact me.\n\n| Paypal | Bitcoin | Etherium |\n| ------ | ------- | -------- |\n|   |  \u003ccenter\u003e![BTC](.travis/btc_segwit.png)\u003cbr/\u003e[3CtUY6Ag2zsvm1JyqeeKeK8kjdG7Tnjr5W](bitcoin:3CtUY6Ag2zsvm1JyqeeKeK8kjdG7Tnjr5W)\u003c/center\u003e | \u003ccenter\u003e![ETH](.travis/eth.png)\u003cbr/\u003e[0x20608A71470Bc84a3232621819f578Fb9C02A460](etherium:0x20608A71470Bc84a3232621819f578Fb9C02A460)\u003c/center\u003e |\n\n## License\n\nThe project is released under dual license: GPLv3, or Commercial license.\n\nCopyright 2024 (C) Alexey Dynda\n\nThis file is part of uProfiler Library.\n\nGNU General Public License Usage\n\nProtocol Library is free software: you can redistribute it and/or modify\nit under the terms of the GNU Lesser General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nProtocol Library is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU Lesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public License\nalong with Protocol Library.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n\nCommercial License Usage\n\nLicensees holding valid commercial uProfiler licenses may use this file in\naccordance with the commercial license agreement provided in accordance with\nthe terms contained in a written agreement between you and Alexey Dynda.\nFor further information contact via email on github account.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flexus2k%2Fuprofiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flexus2k%2Fuprofiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flexus2k%2Fuprofiler/lists"}