ARA: Automatic Instance-Level Analysis in Real- Time Systems Gerion - - PowerPoint PPT Presentation

ara automatic instance level analysis in real time systems
SMART_READER_LITE
LIVE PREVIEW

ARA: Automatic Instance-Level Analysis in Real- Time Systems Gerion - - PowerPoint PPT Presentation

ARA: Automatic Instance-Level Analysis in Real- Time Systems Gerion Entrup , Benedikt Steinmeier, Christian Dietrich Leibniz Universitt Hannover July 9, 2019 supported by A Hard Beginning Repository size: 65 MiB Time Systems Motivation


slide-1
SLIDE 1

ARA: Automatic Instance-Level Analysis in Real- Time Systems

Gerion Entrup, Benedikt Steinmeier, Christian Dietrich

Leibniz Universität Hannover

July 9, 2019

supported by

slide-2
SLIDE 2

A Hard Beginning

Getting a FreeRTOS project from Github:

% git clone https://github.com/grafalex82/GPSLogger Cloning into 'GPSLogger'... remote: Enumerating objects: 1245, done. remote: Counting objects: 100% (1245/1245), done. remote: Compressing objects: 100% (666/666), done. remote: Total 9544 (delta 683), reused 992 (delta 567), pack-reused 8299 Receiving objects: 100% (9544/9544), 52.33 MiB | 9.47 MiB/s, done. Resolving deltas: 100% (6615/6615), done.

Repository size: 65 MiB 134 000 lines of code

What is the systems architecture?

LUH ARA: Automatic Instance-Level Analysis in Real- Time Systems – Motivation 2 – 21

slide-3
SLIDE 3

A Hard Beginning

Getting a FreeRTOS project from Github:

% git clone https://github.com/grafalex82/GPSLogger Cloning into 'GPSLogger'... remote: Enumerating objects: 1245, done. remote: Counting objects: 100% (1245/1245), done. remote: Compressing objects: 100% (666/666), done. remote: Total 9544 (delta 683), reused 992 (delta 567), pack-reused 8299 Receiving objects: 100% (9544/9544), 52.33 MiB | 9.47 MiB/s, done. Resolving deltas: 100% (6615/6615), done.

Repository size: 65 MiB 134 000 lines of code

What is the systems architecture?

LUH ARA: Automatic Instance-Level Analysis in Real- Time Systems – Motivation 2 – 21

slide-4
SLIDE 4

The Instance Graph

OSPERT’18: Levels of Specialization in Real-Time Operating Systems

Serial DMA

ISR

GPS

Thread

Logging

Queue

SD Writer

Thread

LED

Thread

Lock

Semaphore

Display

Thread

SPI DMA

ISR

Button

Thread

Events

Queue

I2C DMA

ISR

sleep sleep wait wakeup wait wakeup wait wakeup lock lock put get put get

Get instances of OS abstractions. Get interactions between them.

LUH ARA: Automatic Instance-Level Analysis in Real- Time Systems – Motivation 3 – 21

slide-5
SLIDE 5

The Instance Graph

OSPERT’18: Levels of Specialization in Real-Time Operating Systems

Serial DMA

ISR

GPS

Thread

Logging

Queue

SD Writer

Thread

LED

Thread

Lock

Semaphore

Display

Thread

SPI DMA

ISR

Button

Thread

Events

Queue

I2C DMA

ISR

sleep sleep wait wakeup wait wakeup wait wakeup lock lock put get put get

We have extracted the graph manually! Not possible for larger code bases. We need automation!

LUH ARA: Automatic Instance-Level Analysis in Real- Time Systems – Motivation 3 – 21

slide-6
SLIDE 6

Automatic Real-Time Systems Analyzer (ARA)

Automatic instance graph extraction Static source code analysis

Application as input

Supports multiple RTOS interfaces. (currently FreeRTOS and OSEK/AUTOSAR) Fields of use:

System overview Knowledge extraction for specialization OS-API usage validation

LUH ARA: Automatic Instance-Level Analysis in Real- Time Systems – Motivation 4 – 21

slide-7
SLIDE 7

Agenda

Motivation Technique Experiments Conclusion

LUH ARA: Automatic Instance-Level Analysis in Real- Time Systems – Motivation 5 – 21

slide-8
SLIDE 8

ARA in a Nutshell

Source ARA

TaskHandle_t h = NULL; i n t main () { xTaskCreate (vTask1 , ”Task1” , NULL) ; xTaskCreate (vTask2 , ”Task2” , &h ) ; vTaskStartScheduler ( ) ; // should never reach t h i s while (1 ); return 0; } void vTask1 ( void ∗ param) { while (1) { do_stuff ( ) ; vTaskDelay (100); } } void vTask2 ( void ∗ param) { do_long_operation ( ) ; xTaskDelete (h) }

RTOS-API Control fmow analysis Control fmow analysis RTOS mapping RTOS mapping Value analysis Value analysis

Serial DMA

ISR

GPS

Thread

Logging

Queue

SD Writer

Thread

LED

Thread

Lock

Semaphore

Display

Thread

SPI DMA

ISR

Button

Thread

Events

Queue

I2C DMA

ISR

sleep sleep wait wakeup wait wakeup wait wakeup lock lock put get put get

Instance graph Instance graph

programmed against LUH ARA: Automatic Instance-Level Analysis in Real- Time Systems – Technique 6 – 21

slide-9
SLIDE 9

ARA in a Nutshell

Source ARA

TaskHandle_t h = NULL; i n t main () { xTaskCreate (vTask1 , ”Task1” , NULL) ; xTaskCreate (vTask2 , ”Task2” , &h ) ; vTaskStartScheduler ( ) ; // should never reach t h i s while (1 ); return 0; } void vTask1 ( void ∗ param) { while (1) { do_stuff ( ) ; vTaskDelay (100); } } void vTask2 ( void ∗ param) { do_long_operation ( ) ; xTaskDelete (h) }

RTOS-API Control fmow analysis Control fmow analysis RTOS mapping RTOS mapping Value analysis Value analysis

Serial DMA

ISR

GPS

Thread

Logging

Queue

SD Writer

Thread

LED

Thread

Lock

Semaphore

Display

Thread

SPI DMA

ISR

Button

Thread

Events

Queue

I2C DMA

ISR

sleep sleep wait wakeup wait wakeup wait wakeup lock lock put get put get

Instance graph Instance graph

programmed against LUH ARA: Automatic Instance-Level Analysis in Real- Time Systems – Technique 6 – 21

slide-10
SLIDE 10

OSEK/AUTOSAR vs. FreeRTOS

TASK t1 { PRIORITY = 1; SCHEDULE = FULL; AUTOSTART = TRUE; } TASK t2 { PRIORITY = 2; SCHEDULE = FULL; }

.oil

OSEK/AUTOSAR

TASK(t1) { ActivateTask(t2); } TASK(t2) { TerminateTask(); }

.cpp

TaskHandle_t t1, t2; int main() { t1 = xTaskCreate(task_1 , 2); t2 = xTaskCreate(task_2 , 1); vTaskStartScheduler(); } task_1 { // priority: 2 vTaskNotifyGive(t1); } task_2 { // priority: 1 while (true) { ulTaskNotifyTake(); vTaskDelete(NULL); } }

.cpp

FreeRTOS

LUH ARA: Automatic Instance-Level Analysis in Real- Time Systems – Technique 7 – 21

slide-11
SLIDE 11

RTOS Mapping

Detect all system calls Create unifjed model

# OSEK "ActivateTask": (os_type.activate , ...) "TerminateTask": (os_type.destroy , ...) "GetResource": (os_type.take, ...) "ReleaseResource": (os_type.commit , ...) # FreeRTOS "xTaskCreate": (os_type.create , ...) "vTaskNotifyGive": (os_type.commit , ...) "ulTaskNotifyTake" : (os_type.take, ...) "xQueueTakeMutexRecursive": (os_type.take, ...) "xQueueGiveMutexRecursive": (os_type.commit , ...)

Create parser for extra data (like OIL fjle).

LUH ARA: Automatic Instance-Level Analysis in Real- Time Systems – Technique 8 – 21

slide-12
SLIDE 12

ARA in a Nutshell

Source ARA

TaskHandle_t h = NULL; i n t main () { xTaskCreate (vTask1 , ”Task1” , NULL) ; xTaskCreate (vTask2 , ”Task2” , &h ) ; vTaskStartScheduler ( ) ; // should never reach t h i s while (1 ); return 0; } void vTask1 ( void ∗ param) { while (1) { do_stuff ( ) ; vTaskDelay (100); } } void vTask2 ( void ∗ param) { do_long_operation ( ) ; xTaskDelete (h) }

RTOS-API Control fmow analysis Control fmow analysis RTOS mapping RTOS mapping Value analysis Value analysis

Serial DMA

ISR

GPS

Thread

Logging

Queue

SD Writer

Thread

LED

Thread

Lock

Semaphore

Display

Thread

SPI DMA

ISR

Button

Thread

Events

Queue

I2C DMA

ISR

sleep sleep wait wakeup wait wakeup wait wakeup lock lock put get put get

Instance graph Instance graph

programmed against LUH ARA: Automatic Instance-Level Analysis in Real- Time Systems – Technique 9 – 21

slide-13
SLIDE 13

ARA in a Nutshell

Source ARA

TaskHandle_t h = NULL; i n t main () { xTaskCreate (vTask1 , ”Task1” , NULL) ; xTaskCreate (vTask2 , ”Task2” , &h ) ; vTaskStartScheduler ( ) ; // should never reach t h i s while (1 ); return 0; } void vTask1 ( void ∗ param) { while (1) { do_stuff ( ) ; vTaskDelay (100); } } void vTask2 ( void ∗ param) { do_long_operation ( ) ; xTaskDelete (h) }

RTOS-API Control fmow analysis Control fmow analysis RTOS mapping RTOS mapping Value analysis Value analysis

Serial DMA

ISR

GPS

Thread

Logging

Queue

SD Writer

Thread

LED

Thread

Lock

Semaphore

Display

Thread

SPI DMA

ISR

Button

Thread

Events

Queue

I2C DMA

ISR

sleep sleep wait wakeup wait wakeup wait wakeup lock lock put get put get

Instance graph Instance graph

programmed against LUH ARA: Automatic Instance-Level Analysis in Real- Time Systems – Technique 9 – 21

slide-14
SLIDE 14

System-Call Aware ICFG

  • 1. Extract interprocedural

control fmow graph (with LLVM).

  • 2. Split calls in separate blocks.
  • 3. Label block types.

system call, call, computation

  • 4. Merge appropriate computation blocks.

create(int) main() int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; create(5); return; int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; create(5); return; create(int) main() int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; create(5); return; int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; create(5); return; create(int) main() int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; create(5); return; int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; create(5); return; create(int) main() int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; create(5); return; int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; create(5); return;

void recv(); void send(); void create(int p2) { int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; } int main() { create(5); return; }

LUH ARA: Automatic Instance-Level Analysis in Real- Time Systems – Technique 10 – 21

slide-15
SLIDE 15

System-Call Aware ICFG

  • 1. Extract interprocedural

control fmow graph (with LLVM).

  • 2. Split calls in separate blocks.
  • 3. Label block types.

system call, call, computation

  • 4. Merge appropriate computation blocks.

create(int) main() int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; create(5); return; int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; create(5); return; create(int) main() int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; create(5); return; int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; create(5); return; create(int) main() int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; create(5); return; int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; create(5); return; create(int) main() int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; create(5); return; int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; create(5); return;

void recv(); void send(); void create(int p2) { int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; } int main() { create(5); return; }

LUH ARA: Automatic Instance-Level Analysis in Real- Time Systems – Technique 10 – 21

slide-16
SLIDE 16

System-Call Aware ICFG

  • 1. Extract interprocedural

control fmow graph (with LLVM).

  • 2. Split calls in separate blocks.
  • 3. Label block types.

system call, call, computation

  • 4. Merge appropriate computation blocks.

create(int) main() int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; create(5); return; int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; create(5); return; create(int) main() int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; create(5); return; int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; create(5); return; create(int) main() int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; create(5); return; int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; create(5); return; create(int) main() int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; create(5); return; int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; create(5); return;

void recv(); void send(); void create(int p2) { int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; } int main() { create(5); return; }

LUH ARA: Automatic Instance-Level Analysis in Real- Time Systems – Technique 10 – 21

slide-17
SLIDE 17

System-Call Aware ICFG

  • 1. Extract interprocedural

control fmow graph (with LLVM).

  • 2. Split calls in separate blocks.
  • 3. Label block types.

system call, call, computation

  • 4. Merge appropriate computation blocks.

create(int) main() int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; create(5); return; int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; create(5); return; create(int) main() int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; create(5); return; int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; create(5); return; create(int) main() int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; create(5); return; int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; create(5); return; create(int) main() int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; create(5); return; int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; create(5); return;

void recv(); void send(); void create(int p2) { int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; } int main() { create(5); return; }

LUH ARA: Automatic Instance-Level Analysis in Real- Time Systems – Technique 10 – 21

slide-18
SLIDE 18

ARA in a Nutshell

Source ARA

TaskHandle_t h = NULL; i n t main () { xTaskCreate (vTask1 , ”Task1” , NULL) ; xTaskCreate (vTask2 , ”Task2” , &h ) ; vTaskStartScheduler ( ) ; // should never reach t h i s while (1 ); return 0; } void vTask1 ( void ∗ param) { while (1) { do_stuff ( ) ; vTaskDelay (100); } } void vTask2 ( void ∗ param) { do_long_operation ( ) ; xTaskDelete (h) }

RTOS-API Control fmow analysis Control fmow analysis RTOS mapping RTOS mapping Value analysis Value analysis

Serial DMA

ISR

GPS

Thread

Logging

Queue

SD Writer

Thread

LED

Thread

Lock

Semaphore

Display

Thread

SPI DMA

ISR

Button

Thread

Events

Queue

I2C DMA

ISR

sleep sleep wait wakeup wait wakeup wait wakeup lock lock put get put get

Instance graph Instance graph

programmed against LUH ARA: Automatic Instance-Level Analysis in Real- Time Systems – Technique 11 – 21

slide-19
SLIDE 19

ARA in a Nutshell

Source ARA

TaskHandle_t h = NULL; i n t main () { xTaskCreate (vTask1 , ”Task1” , NULL) ; xTaskCreate (vTask2 , ”Task2” , &h ) ; vTaskStartScheduler ( ) ; // should never reach t h i s while (1 ); return 0; } void vTask1 ( void ∗ param) { while (1) { do_stuff ( ) ; vTaskDelay (100); } } void vTask2 ( void ∗ param) { do_long_operation ( ) ; xTaskDelete (h) }

RTOS-API Control fmow analysis Control fmow analysis RTOS mapping RTOS mapping Value analysis Value analysis

Serial DMA

ISR

GPS

Thread

Logging

Queue

SD Writer

Thread

LED

Thread

Lock

Semaphore

Display

Thread

SPI DMA

ISR

Button

Thread

Events

Queue

I2C DMA

ISR

sleep sleep wait wakeup wait wakeup wait wakeup lock lock put get put get

Instance graph Instance graph

programmed against LUH ARA: Automatic Instance-Level Analysis in Real- Time Systems – Technique 11 – 21

slide-20
SLIDE 20

Value Analysis

Get arguments for system calls. Backward search from the call site. Follow def-use chain. Follow callee-caller relationship. Take unambiguous values.

void recv(); void send(); void create(int p2) { int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; } int main() { create(5); return; }

LUH ARA: Automatic Instance-Level Analysis in Real- Time Systems – Technique 12 – 21

slide-21
SLIDE 21

Value Analysis

Get arguments for system calls. Backward search from the call site. Follow def-use chain. Follow callee-caller relationship. Take unambiguous values.

void recv(); void send(); void create(int p2) { int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; } int main() { create(5); return; }

LUH ARA: Automatic Instance-Level Analysis in Real- Time Systems – Technique 12 – 21

slide-22
SLIDE 22

Value Analysis

Get arguments for system calls. Backward search from the call site. Follow def-use chain. Follow callee-caller relationship. Take unambiguous values.

void recv(); void send(); void create(int p2) { int foo = 0; xTaskCreate(recv, 3); if (foo == 0) foo++; foo += 4; xTaskCreate(send, p2); return; } int main() { create(5); return; }

LUH ARA: Automatic Instance-Level Analysis in Real- Time Systems – Technique 12 – 21

slide-23
SLIDE 23

ARA in a Nutshell

Source ARA

TaskHandle_t h = NULL; i n t main () { xTaskCreate (vTask1 , ”Task1” , NULL) ; xTaskCreate (vTask2 , ”Task2” , &h ) ; vTaskStartScheduler ( ) ; // should never reach t h i s while (1 ); return 0; } void vTask1 ( void ∗ param) { while (1) { do_stuff ( ) ; vTaskDelay (100); } } void vTask2 ( void ∗ param) { do_long_operation ( ) ; xTaskDelete (h) }

RTOS-API Control fmow analysis Control fmow analysis RTOS mapping RTOS mapping Value analysis Value analysis

Serial DMA

ISR

GPS

Thread

Logging

Queue

SD Writer

Thread

LED

Thread

Lock

Semaphore

Display

Thread

SPI DMA

ISR

Button

Thread

Events

Queue

I2C DMA

ISR

sleep sleep wait wakeup wait wakeup wait wakeup lock lock put get put get

Instance graph Instance graph

programmed against LUH ARA: Automatic Instance-Level Analysis in Real- Time Systems – Technique 13 – 21

slide-24
SLIDE 24

ARA in a Nutshell

Source ARA

TaskHandle_t h = NULL; i n t main () { xTaskCreate (vTask1 , ”Task1” , NULL) ; xTaskCreate (vTask2 , ”Task2” , &h ) ; vTaskStartScheduler ( ) ; // should never reach t h i s while (1 ); return 0; } void vTask1 ( void ∗ param) { while (1) { do_stuff ( ) ; vTaskDelay (100); } } void vTask2 ( void ∗ param) { do_long_operation ( ) ; xTaskDelete (h) }

RTOS-API Control fmow analysis Control fmow analysis RTOS mapping RTOS mapping Value analysis Value analysis

Serial DMA

ISR

GPS

Thread

Logging

Queue

SD Writer

Thread

LED

Thread

Lock

Semaphore

Display

Thread

SPI DMA

ISR

Button

Thread

Events

Queue

I2C DMA

ISR

sleep sleep wait wakeup wait wakeup wait wakeup lock lock put get put get

Instance graph

programmed against LUH ARA: Automatic Instance-Level Analysis in Real- Time Systems – Technique 13 – 21

slide-25
SLIDE 25

Instance Graph Creation

Instance creation in branch or loop?

ARA marks them with “?”.

Instance creation before or after scheduler start?

Before: Only runs once. After: Unknown number of runs. ARA sets “late” attribute.

main T1 late: False T2 late: True

xTaskCreate xTaskCreate?

LUH ARA: Automatic Instance-Level Analysis in Real- Time Systems – Technique 14 – 21

slide-26
SLIDE 26

Agenda

Motivation Technique Experiments Conclusion

LUH ARA: Automatic Instance-Level Analysis in Real- Time Systems – Experiments 15 – 21

slide-27
SLIDE 27

Experiments

Show viability of approach. Tested with 4 real-world systems:

GPSLogger (FreeRTOS) SmartPlug1 (FreeRTOS) I4Copter with events (OSEK) I4Copter without events (OSEK)

Implemented three validation tests:

FreeRTOS: Only ISR-capable system calls used in ISRs? OSEK: Does OIL-fjle match the source code? FreeRTOS/OSEK: Enter and exit of critical region always pairwise?

1https://github.com/KKoovalsky/Smartplug LUH ARA: Automatic Instance-Level Analysis in Real- Time Systems – Experiments 16 – 21

slide-28
SLIDE 28

SmartPlug

RTOS MQTT late: False vTaskDelay HTTPDaemon late: False configConnect late: False ulTaskNotifyTake xTaskGetCurrentTaskHandle xTaskCreate? vTaskDelete vTaskDelay vTaskDelete PowerGet late: True xTaskCreate? xConfiguratorQueue late: False vQueueDelete vTaskDelayUntil vTaskDelay xMqttQueue late: False xQueueGenericSend xQueueReceive StartUp late: False vTaskDelay vTaskDelete GatewayAddr late: False vTaskDelay vTaskDelete Blink late: False vTaskDelay PLCInit late: False vTaskDelay vTaskDelete PLCRcv late: False ulTaskNotifyTake Regis late: True xTaskCreate? xQueueGenericSend xPLCSendSemaphore late: False xQueueGenericSend vTaskDelete xQueueGenericSend PLCSend late: False xQueueSemaphoreTake ulTaskNotifyTake xQueueGenericSend hostIntPinHandler late: False vTaskNotifyGiveFromISR main vTaskStartScheduler xTaskCreate? xTaskCreate? xTaskCreate? xQueueGenericCreate? xTaskCreate? xTaskCreate? xTaskCreate xTaskCreate xTaskCreate xQueueGenericCreate? xQueueCreateMutex xTaskCreate xQueueReceive

MQTT late: False vTaskDelay HTTPDaemon late: False configConnect late: False xTa xTaskCreate? vTaskDelete vTaskDelay vTaskDelete xConfiguratorQueue late: False vQueueDelete xQueueReceive xTaskCreate? xTaskCreate? xQueueReceive LUH ARA: Automatic Instance-Level Analysis in Real- Time Systems – Experiments 17 – 21

slide-29
SLIDE 29

SmartPlug

RTOS MQTT late: False vTaskDelay HTTPDaemon late: False configConnect late: False ulTaskNotifyTake xTaskGetCurrentTaskHandle xTaskCreate? vTaskDelete vTaskDelay vTaskDelete PowerGet late: True xTaskCreate? xConfiguratorQueue late: False vQueueDelete vTaskDelayUntil vTaskDelay xMqttQueue late: False xQueueGenericSend xQueueReceive StartUp late: False vTaskDelay vTaskDelete GatewayAddr late: False vTaskDelay vTaskDelete Blink late: False vTaskDelay PLCInit late: False vTaskDelay vTaskDelete PLCRcv late: False ulTaskNotifyTake Regis late: True xTaskCreate? xQueueGenericSend xPLCSendSemaphore late: False xQueueGenericSend vTaskDelete xQueueGenericSend PLCSend late: False xQueueSemaphoreTake ulTaskNotifyTake xQueueGenericSend hostIntPinHandler late: False vTaskNotifyGiveFromISR main vTaskStartScheduler xTaskCreate? xTaskCreate? xTaskCreate? xQueueGenericCreate? xTaskCreate? xTaskCreate? xTaskCreate xTaskCreate xTaskCreate xQueueGenericCreate? xQueueCreateMutex xTaskCreate xQueueReceive

MQTT late: False vTaskDelay HTTPDaemon late: False configConnect late: False xTa xTaskCreate? vTaskDelete vTaskDelay vTaskDelete xConfiguratorQueue late: False vQueueDelete xQueueReceive xTaskCreate? xTaskCreate? xQueueReceive LUH ARA: Automatic Instance-Level Analysis in Real- Time Systems – Experiments 17 – 21

slide-30
SLIDE 30

GPSLogger

RTOS SDThread late: False vTaskDelay sdQueue late: True xQueueGenericCreate xQueueReceive LEDThread late: False vTaskDelay DisplayTask late: False xGPSDataMutex late: True xQueueCreateMutex? xQueueGenericSend xQueueSemaphoreTake GPSTask late: False xQueueSemaphoreTake ButtonsThread late: False vTaskDelay buttonsQueue late: False xQueueGenericSend xQueueReceive ulTaskNotifyTake xTaskGetCurrentTaskHandle xQueueGenericSend xQueueCreateMutex? xQueueGenericSend vTaskDelay _ZN14SdFatSPIDriver22dmaTransferCompletedCBEv late: False xQueueGiveFromISR HAL_I2C_MemTxCpltCallback late: False vTaskNotifyGiveFromISR USART1_IRQHandler late: False vTaskNotifyGiveFromISR main vTaskStartScheduler xTaskCreate xTaskCreate xTaskCreate xTaskCreate xQueueGenericCreate xTaskCreate

DisplayTask late: False xGPSDataMutex late: True xQueueCreateMutex? xQueueGenericSend xQueueSemaphoreTake GPSTask late: False xQueueSemaphoreTake xQueueGenericSend xQueueCreateMutex? xQueueGenericSend vTaskDelay xTaskCreate LUH ARA: Automatic Instance-Level Analysis in Real- Time Systems – Experiments 18 – 21

slide-31
SLIDE 31

GPSLogger

RTOS SDThread late: False vTaskDelay sdQueue late: True xQueueGenericCreate xQueueReceive LEDThread late: False vTaskDelay DisplayTask late: False xGPSDataMutex late: True xQueueCreateMutex? xQueueGenericSend xQueueSemaphoreTake GPSTask late: False xQueueSemaphoreTake ButtonsThread late: False vTaskDelay buttonsQueue late: False xQueueGenericSend xQueueReceive ulTaskNotifyTake xTaskGetCurrentTaskHandle xQueueGenericSend xQueueCreateMutex? xQueueGenericSend vTaskDelay _ZN14SdFatSPIDriver22dmaTransferCompletedCBEv late: False xQueueGiveFromISR HAL_I2C_MemTxCpltCallback late: False vTaskNotifyGiveFromISR USART1_IRQHandler late: False vTaskNotifyGiveFromISR main vTaskStartScheduler xTaskCreate xTaskCreate xTaskCreate xTaskCreate xQueueGenericCreate xTaskCreate

DisplayTask late: False xGPSDataMutex late: True xQueueCreateMutex? xQueueGenericSend xQueueSemaphoreTake GPSTask late: False xQueueSemaphoreTake xQueueGenericSend xQueueCreateMutex? xQueueGenericSend vTaskDelay xTaskCreate LUH ARA: Automatic Instance-Level Analysis in Real- Time Systems – Experiments 18 – 21

slide-32
SLIDE 32

Future Work

Build a global control fmow graph (GCFG) [DHL17].

Include scheduler decisions.

Improve value analysis.

Alias analysis. Model ambiguous values.

Interactive graph browsing.

Link source code and instance graph.

LUH ARA: Automatic Instance-Level Analysis in Real- Time Systems – Conclusion 19 – 21

slide-33
SLIDE 33

Conclusion

ARA2

Automatic extraction of an instance graph. Supports multiple RTOS interfaces. Show viability with 4 real-world applications.

Fields of use:

Application architecture overview. Knowledge extraction for specialization. OS-API usage validation.

Thank you! Questions?

2https://github.com/luhsra/ara LUH ARA: Automatic Instance-Level Analysis in Real- Time Systems – Conclusion 20 – 21

slide-34
SLIDE 34

Conclusion

ARA2

Automatic extraction of an instance graph. Supports multiple RTOS interfaces. Show viability with 4 real-world applications.

Fields of use:

Application architecture overview. Knowledge extraction for specialization. OS-API usage validation.

Thank you! Questions?

2https://github.com/luhsra/ara LUH ARA: Automatic Instance-Level Analysis in Real- Time Systems – Conclusion 20 – 21

slide-35
SLIDE 35

References I

Christian Dietrich, Martin Hofgmann, and Daniel Lohmann. “Global Optimization of Fixed-Priority Real-Time Systems by RTOS-Aware Control-Flow Analysis”. In: ACM Transactions on Embedded Computing Systems 16.2 (2017), 35:1–35:25. doi: 10.1145/2950053.

LUH ARA: Automatic Instance-Level Analysis in Real- Time Systems – Conclusion 21 – 21