| 1 |
// target tapset |
| 2 |
// Copyright (C) 2019 Red Hat Inc. |
| 3 |
// |
| 4 |
// This file is part of systemtap, and is free software. You can |
| 5 |
// redistribute it and/or modify it under the terms of the GNU General |
| 6 |
// Public License (GPL); either version 2, or (at your option) any |
| 7 |
// later version. |
| 8 |
|
| 9 |
// TODO: get 'call' instruction to handle the functions below |
| 10 |
|
| 11 |
/** |
| 12 |
* function _set_procfs_value - Used to set the message |
| 13 |
* from a procfs-like probe. |
| 14 |
* |
| 15 |
* Description: This function always returns 0. |
| 16 |
*/ |
| 17 |
|
| 18 |
function _set_procfs_value:long (msg:string) |
| 19 |
%{/* bpf */ |
| 20 |
0xbf, 1, $msg, -, -; /* mov r1, $msg */ |
| 21 |
0x85, 0, 0, 0, -6; /* call BPF_FUNC_SET_PROCFS_VALUE */ |
| 22 |
0xbf, $$, 0, -, -; /* return r0 */ |
| 23 |
%} |
| 24 |
|
| 25 |
/** |
| 26 |
* function _append_procfs_value - Used to append to |
| 27 |
* the message for a procfs-like probe. |
| 28 |
* |
| 29 |
* Description: This function always returns 0. |
| 30 |
*/ |
| 31 |
|
| 32 |
function _append_procfs_value:long (append:string) |
| 33 |
%{/* bpf */ |
| 34 |
0xbf, 1, $append, -, -; /* mov r1, $msg */ |
| 35 |
0x85, 0, 0, 0, -7; /* call BPF_FUNC_APPEND_PROCFS_VALUE */ |
| 36 |
0xbf, $$, 0, -, -; /* return r0 */ |
| 37 |
%} |
| 38 |
|
| 39 |
/** |
| 40 |
* function _get_procfs_value - Used to get the message |
| 41 |
* for a procfs-like probe. |
| 42 |
* |
| 43 |
* Description: This function returns a pointer to the |
| 44 |
* message. |
| 45 |
*/ |
| 46 |
|
| 47 |
function _get_procfs_value:string () |
| 48 |
%{/* bpf */ |
| 49 |
0x85, 0, 0, 0, -8; /* call BPF_FUNC_GET_PROCFS_VALUE */ |
| 50 |
0xbf, $$, 0, -, -; /* return r0 */ |
| 51 |
%} |