/usr/share/systemtap/tapset/dyninst/endian.stp is in systemtap-common 2.3-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | // NB: functionally equivalent to linux/endian.stp
%{
#include <endian.h>
%}
function big_endian2:long (val:long) %{ /* pure */
STAP_RETVALUE = htobe16((uint16_t)STAP_ARG_val);
%}
function big_endian4:long (val:long) %{ /* pure */
STAP_RETVALUE = htobe32((uint32_t)STAP_ARG_val);
%}
function big_endian8:long (val:long) %{ /* pure */
STAP_RETVALUE = htobe64((uint64_t)STAP_ARG_val);
%}
function little_endian2:long (val:long) %{ /* pure */
STAP_RETVALUE = htole16((uint16_t)STAP_ARG_val);
%}
function little_endian4:long (val:long) %{ /* pure */
STAP_RETVALUE = htole32((uint32_t)STAP_ARG_val);
%}
function little_endian8:long (val:long) %{ /* pure */
STAP_RETVALUE = htole64((uint64_t)STAP_ARG_val);
%}
|