P7 baical linux build

P7 baical linux build

μP7 (micro P7) is lightweight C library for sending trace/logs & telemetry data from your Micro-controller’s firmware to host/HW FIFO/cycle buffer/network/etc. for further analysis. It is designed to be integrated on almost every microcontroller, even with very limited resources.

The library is oriented on firmware developers (Bare-metal or RTOS) & real-time task. contains exhaustive documentation inside package.

Features:

  • extremely low memory usage, (900 lines of code, no dynamic memory allocation, all traces/logs format strings are removed from compilation & binaries)
    • ОјP7 instance – 408 bytes of heap + 264 bytes in .BSS
    • 40 bytes of heap per trace/telemetry item (allocated at initialization)
  • Speed is priority, library is designed to minimize time per trace/telemetry call, for example average performance for Intel i7-870 is:
    • 15 million traces per second
    • 23 million telemetry samples per second
  • Unicode support (UTF-8, UTF-16, UTF-32)
  • No external dependencies
  • Different host’s sinks (transport & storages) are supported:
    • Network (Baical server)
    • Binary File
    • Text File (Linux: UTF-8, Windows: UTF-16)
    • Console
    • Syslog (RFC 5424)
    • Auto (Baical server if reachable, else — binary file)
    • Null
  • Files rotation setting (by size or time)
  • Files max count setting (deleting old files automatically)
  • Remote management from Baical server (set verbosity per module, enable/disable telemetry counters)
  • Trace & telemetry files have compact binary format (due to speed requirements — binary files much more compact than raw text), export to text is available
  • Command line interface for configuration may be used in addition to application parameters
  • Big/Little endian support
  • Soft Microprocessors (MicroBlaze, Risc-V, NIOS), ARM, etc.
  • GCC, Clang

Components

ОјP7 consist of next components/tools:

  • ОјP7 library (will be part of user firmware)
  • ОјP7 proxy library (will communicate with firmware from host and convert ОјP7 protocol to P7)
  • ОјP7 pre-processor (will be used to pre-process firmware source code before compilation)

Trace

From software engineer’s point of view trace is a source code line (function with variable arguments list):

And at another side it looks like that:

It is very similar to logging, but unlike logging — trace gives your much better performance in term of CPU cycles and transmission data bandwidth. To reach best performance next optimizations are used:

  • Do not format trace string on CPU side, variable arguments formatting is a heavy operation and it will be done on server side by request
  • Do not transmit duplicated/redundant information, for example string «Iteration %I64d» won’t be sent to host, it will be even stripped out from the firmware
  • Deliver only changes for every subsequent trace call [ variable arguments, sequence number, time with 100ns granularity, current thread, processor core number ]
  • Use binary protocol instead of sending text
  • Use of pre-processor to collect all possible information in advance (file names, function names, code lines, etc.)

Telemetry

From software engineer’s point of view telemetry is a few source code lines:

And at another side it may looks like that (thread cyclograms, buffers sizes, delays, handles count, etc.):

Telemetry is a simple and fast way to record any dynamically changed values for further or real time analysis on Baical server side. You may use it for a lot of things: system statistics (cpu, memory, hdd, etc.), buffers filling, threads cyclograms or synchronization, mutexes, networks delays, packets sizes, etc. There are plenty of possible usage cases.

Источник

P7 baical linux build

P7 is open source and cross-platform library for high-speed sending telemetry & trace data from your application with minimal usage of CPU and memory. Library contains exhaustive documentation inside package.

Читайте также:  Linux rdp server debian

Features:

  • C++/C/C#/Python support
  • Cross platform (Linux x86/x64, Windows x86/x64)
  • Speed is priority, library and server are designed and optimized to suit high load, for example average performance for Intel i7-870 (more than 10 years old CPU) is Traces:
    • 0,5% CPU, one core: 450 000 traces per second (binary file or network)
    • 100% CPU, one core:

    5.7 million traces per second to network
    100% CPU, one core:

    10 million traces per second to binary file

Telemetry:

  • 0,5% CPU, one core: 600 000 telemetry samples per second (binary file or network)
  • 100% CPU, one core:

    6.8 million telemetry samples per second to network
    100% CPU, one core:

    11 million telemetry samples per second to binary file

  • Small memory footprint (optional, min is 16KB) — used for embedded devices
  • Thread safe
  • Unicode support (UTF-8, UTF-32 for Linux, UTF-16 for Windows)
  • ANSI char support
  • No external dependencies
  • High-resolution time stamps (resolution depends on HW high-resolution performance counter, usually it is 100ns)
  • Different sinks (transport & storages) are supported:
    • Network (Baical server)
    • Binary File
    • Text File (Linux: UTF-8, Windows: UTF-16)
    • Console
    • Syslog (RFC 5424)
    • Auto (Baical server if reachable, else — binary file)
    • Null
  • Files rotation setting (by size or time)
  • Files max count setting (deleting old files automatically)
  • Remote management from Baical server (set verbosity per module, enable/disable telemetry counters)
  • Shared memory is used — create your trace and telemetry channels once and access it from any process module or class without passing handles
  • Crash handler or in case of user defined crash handler — special function to flush all P7 buffers for all P7 objects inside process in case of crush
  • Trace & telemetry files have compact binary format (due to speed requirements — binary files much more compact than raw text), export to text is available
  • Command line interface for configuration may be used in addition to application parameters
  • Big/Little endian support
  • Intel/AMD, ARM, MCST, PowerPC, Baikal T1, etc.
  • GCC, VC++, Clang, MinGW
  • Components

    Internally P7 has very simple design, and consist of few sub-modules:

    • Channel — named data channel, used for wrapping user data into internal P7 format. For now there are next channels types are available:
      • Telemetry
      • Trace
    • Sink — module which provides a way of delivering serialized data from channels to final destination. Next types are available for now:
      • Network — deliver data directly to Baical server
      • Binary File — writes all user data into single binary file
      • Text File — writes all user data into single text file (Linux: UTF-8, Windows: UTF-16)
      • Console — writes all user data into console
      • Syslog — writes all user data into UDP socket using Syslog format
      • Auto — delivers to Baical server if it is reachable otherwise to file
      • Null — drops all incoming data, save CPU for the hosting process
    • Client — is a core module, it aggregate sink & channels together and manage them. Every client object can handle up to 32 independent channels

    Let’s take an example (diagram below) — developed application has to write 2 independent log (trace) streams and 1 telemetry stream, and delivers them directly to Baical. Initialization sequence will be:

    1. First of all you need to create P7 Client, and specify parameters for sink ”/P7.Sink=Baical /P7.Addr=127.0.0.1”
    2. Using the client create:
      • first trace channel with name ”Core”
      • second trace channel named ”Module A”
      • telemetry channel named ”CPU, MEM”

    Trace

    From software engineer’s point of view trace is a source code line (function with variable arguments list):

    And at another side it looks like that:

    It is very similar to logging, but unlike logging — trace gives your much more freedom, you don’t have to choose which information to write, you may write everything (without impacting on application performance, 50K traces per second with 0.5% CPU for example, for details see Speed test chapter in documentation) and then during debugging session use flexible filtering engine to find interesting parts, in this case you will be sure that all necessary information is available for you.

    This approach became possible due to P7 performance. Trace module was designed with the idea of performance, especially on small embedded system.

    To be able to send so much information next optimizations are used:

    • Do not delivers & records duplicated information every time — the most heavy text fields [ Format string, Function name, File name, File line number, Module ID ] are delivered & recorded once — only for first call (the same information will be transmitted once in case of new connection establishing)
    • Do not format trace string on client side, variable arguments formatting is a heavy operation and it will be done on server side by request
    • Deliver only changes for every subsequent trace call [ variable arguments, sequence number, time with 100ns granularity, current thread, processor core number ]

    N.B.: The best performance is provided by C++ and C interfaces (release build), C# & Python wrappers provides less performing solutions.

    Telemetry

    From software engineer’s point of view telemetry is a few source code lines:

    And at another side it may looks like that (thread cyclograms, buffers sizes, delays, handles count, etc.):

    Telemetry is a simple and fast way to record any dynamically changed values for further or real time analysis on Baical server side. You may use it for a lot of things: system statistics (cpu, memory, hdd, etc.), buffers filling, threads cyclograms or synchronization, mutexes, networks delays, packets sizes, etc. There are plenty of possible usage cases.

    Some facts about telemetry:

    • Every telemetry channel can handle up to 65k independent counters
    • No (or minimal) impact on application performance — on modern hardware (2014) spend only 300 ns for processing one telemetry sample (add(. ) -> network -> Baical srv -> HDD), it is about 220 000 of samples per second with about 1% CPU usage
    • You can enable or disable counters online from Baical server — it allows you visualize and record only necessary data
    • Every telemetry sample contains 64 bit signed value & high resolution time stamp

    Источник

    P7 baical linux build

    P7 library. Source code

    P7 library v5.6 source code, examples, tests & documentation. Changelog

    Features:

    • Cross platform (Linux x86/x64, Windows 2000 and newer x86/x64)
    • Development language is C++
    • C/C#/Python support
    • Thread safe
    • Big variety of sinks: Baical, Binary file, Text file, Console, Syslog, Null
    • Unicode support (UTF-8, UTF-32 for Linux, UTF-16 for Windows)
    • No external dependencies
    • Compilers: GCC, VC++, Clang, MinGW
    • Fastest open source logger & telemetry library
    • Big/Little endian support
    • Intel/AMD, ARM, MCST, PowerPC, Baikal T1, etc.

    ОјP7 library. Source code

    ОјP7 library v1.8 source code, examples, tests & documentation. Changelog

    Features:

    • Micro-controller’s firmware oriented (Bare metal, RTOS)
    • Development language is C
    • Big variety of sinks: Baical, Binary file, Text file, Console, Syslog, Null
    • Unicode support (UTF-8, UTF-32)
    • No external dependencies
    • Compilers: GCC, Clang
    • Fastest open source logger & telemetry library
    • Big/Little endian support
    • MicroBlaze, Risc-V, NIOS, ARM, etc.

    Baical server. Windows, portable version

    N.B.: to convert portable version to «per user» please delete file Baical.xml from application folder and restart the server — new config file will be create in user documents folder

    To see Baical in action next log and dump files may be downloaded:

    • Log file example (data was received and saved by Baical server).
    • P7 dump file example (Baical server was inaccessible and data was saved by user application)

    Baical server x64 v5.3.1 Windows portable server (64 bits).

    Baical server x64 v5.3.0 Windows portable server (64 bits).

    Baical server x64 v5.2.0 Windows portable server (64 bits).

    Источник

    Baikal-M

    Данная страница находится в разработке.
    Эта страница ещё не закончена. Информация, представленная здесь, может оказаться неполной или неверной.

    На данный момент страничка описывает выпуск Simply Linux 9.1 для системной платы TF-307 на основе процессора BE-M1000 производства «Байкал Электроникс».

    Содержание

    Поддерживаемые устройства [ править ]

    • Системная плата TF307-MB-S-D и устройства на ее основе
    • Таблица совместимости устройств, прошивок на базе SDK различных версий и выпущенных дистрибутивов.
    • Таблица совместимости программного обеспечения.

    Перед началом установки [ править ]

    На плате должен быть прошит firmware из SDK-M версий 4.4. или 5.1. С более старыми версиями прошивки эту инструкцию использовать не следует. Окирпичить плату вряд ли выйдет, но времени и нервов потратите много.

    Определение версии прошивки [ править ]

    На глазок версию прошивки можно определить так. Почти сразу после включения отображается маленький логотип Байкал Электроникс. Затем секунд через 20 отображается большой (во весь экран) логотип Байкал Электроникс, а под ним — номер версии прошивки.

    • Если номер версии не отображается, то прошивка старая (SDK-M 4.3 или старее)
    • Если маленький логотип не отображается, то прошивка старая (SDK-M 4.2 или старее)
    • Если во время загрузки на экране ничего нет, это слишком старая прошивка

    Установка [ править ]

    Его нужно записать на внешний USB накопитель, sd карту, либо жесткий диск.

    • ВНИМАНИЕ! ВСЕ ДАННЫЕ, КОТОРЫЕ НАХОДЯТСЯ НА НОСИТЕЛЕ, БУДУТ БЕЗВОЗВРАТНО СТЕРТЫ!
    • ВНИМАНИЕ! РИСК СТЕРЕТЬ НЕ ТЕ ДАННЫЕ! ТРИЖДЫ ПРОВЕРЬТЕ, ЧТО ПИШЕТЕ НА НУЖНЫЙ НОСИТЕЛЬ!

    dd if=slinux-9.1-aarch64.iso of=/dev/disk/by-id/XYZ bs=1M conv=fsync

    Затем нужно подключить носитель к плате и загрузиться с него. Если на Байкал-М еще не установлена ОС, то загрузка со съемного носителя происходит по умолчанию. Если по какой-то причине загрузка не началась, нужно нажать Escape во время инициализации UEFI (когда вверху появится надпись «Press ESC for boot options»), и выбрать загрузку с нужного устройства вручную.

    EFI system partition [ править ]

    При разбиении диска вручную не забудьте создать EFI system partition, отформатировать его в файловую систему fat, и назначить точку монтирования /boot/efi

    Известные проблемы [ править ]

    • Частотные искажения при воспроизведении звука на встроенный аналоговый выход. На HDMI звук воспроизводится нормально.
    • PS/2 клавиатуры и мыши не поддерживаются.
    • Блок аппаратного декодирования видео (HD Video Decoder, VDec) не поддерживается. Бинарные драйверы (плагины к gstreamer) от Байкал Электроникс намертво привязаны к определенным версиям системных библиотек (glib2, pcre, libxml, и т.д.), так что невозможно обеспечить их функционирование в каком-либо дистрибутиве, кроме Debian 10. Возможно декодирование видео на GPU при использовании panfrost или на CPU.

    Подключение UART консоли к плате TF307 [ править ]

    Иногда бывает, что при загрузке система виснет, и на экране ничего не отображается. Вот в этих случаях и поможет UART консоль.

    Требуется [ править ]

    • Утилита picocom
    • UART -> USB адаптер, рассчитаный на уровень сигналов 1.8 Вольт.
      ВНИМАНИЕ! Использование адаптеров на 3.3 Вольт ПРИВОДИТ К ПОЛОМКЕ ПЛАТЫ!

    Автор успешно использовал адаптеры, которые определяются как

    USB_адаптера_к_плате»>Подключение UART->USB адаптера к плате [ USB адаптера к плате»»>править ]

    • Разъём обозначен XP8
    • PIN 1 обозначен точкой
    • PIN 13 UART_TX (TX on BM)
    • PIN 14 GND
    • PIN 15 UART_RX (RX on BM)

    Pаспиновка относительно ключа — разрыва пластиковой рамки разъёма:

    Использование UART консоли [ править ]

    После подключения адаптера к плате следует подать питание на плату, но не включать ее. Далее нужно

    1. Подключить USB разъем адаптера к компьютеру. При успешном подключении в системе появится устройство /dev/ttyUSB0 (если не подключены другие USB serial устройства)
    2. Подключиться к устройству /dev/ttyUSB0 с помощью программы picocom:
      picocom -b115200 /dev/ttyUSB0
    3. Включить плату, дождаться меню загрузчика grub
    4. Прервать автоматическую загрузку и войти в режим редактирования. Для этого достаточно нажать кнопку e.
    5. В конце строки linux /boot/vmlinuz-XYZ . дописать
      console=ttyS0,115200n8 earlycon=uart8250,mmio32,0x20230000 ignore_loglevel
    6. Продолжить загрузку — нажать кнопку F10.

    После этого в picocom появятся подробные сообщения ядра.

    Обновление прошивки на DBM плате [ править ]

    Требуются [ править ]

    • Утилита dfu-util версии 0.9 или новее
    • микро-USB шнур

    Порядок действий [ править ]

    1. Подключить плату к сети питания. Не включать. Подается дежурное напряжение.
    2. Подключить плату к хост компьютеру (микро-USB разъем XS2, ближайший к Ethernet разъемам)
    3. Прошить файл dbm.scp.flash.bin:
      sudo dfu-util -D ./baikal/prebuilts/dbm.scp.flash.bin -a 0 -s 0x08000000
    4. Прошить файл dbm.flash.img:
      sudo dfu-util -D ./baikal/prebuilts/dbm.flash.img -a 1 -s 0x0A000000
    5. Физически отключить питание платы (отсоединить шнур) на 30 — 60 секунд.

    После прошивки [ править ]

    В процессе прошивки настройки UEFI обнуляются. В связи с этим плата будет загружаться в EFI shell. Для запуска GRUB нужно дать команду
    fs0:\EFI\altlinux\grubaa64.efi
    Для того, чтобы GRUB запускался автоматически, после загрузки ОС следует выполнить команду
    sudo efibootmgr -c —label altlinux —loader \\EFI\\altlinux\\grubaa64.efi

    Источник

    Читайте также:  Itunes его аналоги для windows
    Оцените статью