This section demonstrates data visualization by using an example.
To collect and view data for data visualization:
#include <stdio.h> #include <stdlib.h> #define SIZE 10 #define NO_PRINT // prototypes void swap(int *a, int *b); void print_array(int arr[], int length); int i = 0; long j = 0; int arr[SIZE] = { 4, 6, 7, 1, 2, 3, 4, 12, 4, 5 }; int main(void) { #ifndef NO_PRINT printf("\n\n\n======================================\n"); printf("======================================\n\n"); print_array(arr, SIZE); #endif for (i = 0; i < SIZE - 1; i++) for (j = i; j < SIZE; j++) if (arr[i] > arr[j]) swap(&arr[i], &arr[j]); #ifndef NO_PRINT print_array(arr, SIZE); printf("\n\n... program done.\n"); #endif return (0); } void print_array(int arr[], int length) { int i; printf("Array = "); for (i = 0; i < length; i++) { printf("%d ", arr[i]); } printf("\n"); } void swap(int *a, int *b) { int c = *a; *a = *b; *b = c; }
The Add Globals dialog box appears.
The Add Data Visualization dialog box appears.
The Memory view appears with memory renderings opened.
The Format dialog box appears.
The Add Data Visualization dialog box appears.
The Add Data Visualization dialog box appears.
The Properties dialog box appears.
The New Breakpoint Action dialog box appears.
The resume action appears in the Available actions table in the Properties dialog box.
As the application runs and reaches the second breakpoint, the Data Visualization page opens automatically. It displays the last values in a SWT chart read for each visualization analysispoint.
The Software Analysis view opens and populates with a new result set. Only Trace , Data Visualization and Log are visible. The Data Visualization chart populates with the full set of collected values.
The Trace Data viewer contains the same data.
For more information, refer Data Trace Import Dialog Box.