-
Notifications
You must be signed in to change notification settings - Fork 478
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Split uftrace-script.h from script.h and add version info
This patch factor out script_info and script_context from script.h to uftrace-script.h, which can be included in C/C++ native scripts. In addtion, it also adds version info to script_info and script_context. The major version can be changed when the layout of the struct is changed and the minor version can be changed when a new member is added at the end. Signed-off-by: Honggyu Kim <[email protected]>
- Loading branch information
1 parent
bde18a6
commit c2c22b8
Showing
8 changed files
with
79 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#ifndef UFTRACE_UFTRACE_SCRIPT_H | ||
#define UFTRACE_UFTRACE_SCRIPT_H | ||
|
||
#ifndef __cplusplus | ||
#include <stdint.h> | ||
#include <stdbool.h> | ||
#include "utils/list.h" | ||
#else | ||
#include <cstdint> | ||
#include <cstdbool> | ||
#endif | ||
|
||
/* informantion passed during initialization */ | ||
#define SCRIPT_INFO_MAJOR_VERSION 1 | ||
#define SCRIPT_INFO_MINOR_VERSION 0 | ||
struct script_info { | ||
struct si_version { | ||
uint8_t major; | ||
uint8_t minor; | ||
} ver; | ||
char *name; | ||
char *version; | ||
bool record; | ||
const char *cmds; | ||
}; | ||
|
||
/* context information passed to script */ | ||
#define SCRIPT_CONTEXT_MAJOR_VERSION 1 | ||
#define SCRIPT_CONTEXT_MINOR_VERSION 0 | ||
struct script_context { | ||
struct sc_version { | ||
uint8_t major; | ||
uint8_t minor; | ||
} ver; | ||
int tid; | ||
int depth; | ||
uint64_t timestamp; | ||
uint64_t duration; /* exit only */ | ||
unsigned long address; | ||
char *name; | ||
#ifndef __cplusplus | ||
/* for arguments and return value */ | ||
int arglen; | ||
void *argbuf; | ||
struct list_head *argspec; | ||
#else | ||
/* | ||
* struct list_head internally uses 'new' as a variable name so | ||
* it's not possible to use in C++. | ||
*/ | ||
#endif | ||
}; | ||
|
||
#endif /* UFTRACE_UFTRACE_SCRIPT_H */ |