X7ROOT File Manager
Current Path:
/usr/share/systemtap/tapset/linux
usr
/
share
/
systemtap
/
tapset
/
linux
/
π
..
π
arm
π
arm64
π
atomic.stp
(1.53 KB)
π
aux_syscalls.stp
(143.78 KB)
π
context-caller.stp
(3.07 KB)
π
context-envvar.stp
(1.72 KB)
π
context-symbols.stp
(11.99 KB)
π
context-unwind.stp
(2.81 KB)
π
context.stp
(18.57 KB)
π
context.stpm
(125 B)
π
conversions-guru.stp
(5.74 KB)
π
conversions.stp
(15.34 KB)
π
ctime.stp
(5.54 KB)
π
dentry.stp
(10.11 KB)
π
dev.stp
(1.9 KB)
π
endian.stp
(602 B)
π
guru-delay.stp
(1.2 KB)
π
guru-signal.stp
(1.07 KB)
π
i386
π
ia64
π
inet.stp
(1.42 KB)
π
inet.stpm
(383 B)
π
inet_sock.stp
(1.25 KB)
π
ioblock.stp
(15.04 KB)
π
ioscheduler.stp
(11.89 KB)
π
ip.stp
(5.35 KB)
π
ipmib-filter-default.stp
(965 B)
π
ipmib.stp
(12.68 KB)
π
irq.stp
(5 KB)
π
json.stp
(8.98 KB)
π
json.stpm
(6.11 KB)
π
kprocess.stp
(4.4 KB)
π
kretprobe.stp
(2.1 KB)
π
linuxmib-filter-default.stp
(876 B)
π
linuxmib.stp
(3.63 KB)
π
loadavg.stp
(1.95 KB)
π
logging.stp
(2.12 KB)
π
memory.stp
(18.74 KB)
π
mips
π
netfilter.stp
(35.49 KB)
π
networking.stp
(9.37 KB)
π
nfs.stp
(38.06 KB)
π
nfs_proc.stp
(55.46 KB)
π
nfs_proc.stpm
(1.18 KB)
π
nfsd.stp
(46.27 KB)
π
nfsderrno.stp
(11.7 KB)
π
panic.stp
(1.07 KB)
π
perf.stp
(5.16 KB)
π
powerpc
π
proc_mem.stp
(12.05 KB)
π
pstrace.stp
(773 B)
π
rcu.stp
(928 B)
π
rlimit.stp
(1.35 KB)
π
rpc.stp
(37.67 KB)
π
s390
π
scheduler.stp
(11.36 KB)
π
scsi.stp
(9.47 KB)
π
signal.stp
(28.69 KB)
π
socket.stp
(34.2 KB)
π
sysc_accept.stp
(7.32 KB)
π
sysc_accept4.stp
(7.24 KB)
π
sysc_access.stp
(2.45 KB)
π
sysc_acct.stp
(2.18 KB)
π
sysc_add_key.stp
(2.91 KB)
π
sysc_adjtimex.stp
(5.28 KB)
π
sysc_alarm.stp
(2.52 KB)
π
sysc_bdflush.stp
(2.75 KB)
π
sysc_bind.stp
(6.43 KB)
π
sysc_bpf.stp
(2.33 KB)
π
sysc_brk.stp
(2.33 KB)
π
sysc_capget.stp
(2.71 KB)
π
sysc_capset.stp
(2.71 KB)
π
sysc_chdir.stp
(2.23 KB)
π
sysc_chmod.stp
(2.51 KB)
π
sysc_chown.stp
(3.27 KB)
π
sysc_chown16.stp
(2.61 KB)
π
sysc_chroot.stp
(2.29 KB)
π
sysc_clock_adjtime.stp
(4.72 KB)
π
sysc_clock_getres.stp
(3.82 KB)
π
sysc_clock_gettime.stp
(3.62 KB)
π
sysc_clock_nanosleep.stp
(7.25 KB)
π
sysc_clock_settime.stp
(5.02 KB)
π
sysc_clone.stp
(6.19 KB)
π
sysc_close.stp
(2.47 KB)
π
sysc_connect.stp
(6.82 KB)
π
sysc_copy_file_range.stp
(3.15 KB)
π
sysc_creat.stp
(2.28 KB)
π
sysc_delete_module.stp
(2.87 KB)
π
sysc_dup.stp
(2.09 KB)
π
sysc_dup2.stp
(2.63 KB)
π
sysc_dup3.stp
(2.66 KB)
π
sysc_epoll_create.stp
(5.29 KB)
π
sysc_epoll_ctl.stp
(3.5 KB)
π
sysc_epoll_pwait.stp
(3.49 KB)
π
sysc_epoll_wait.stp
(4.33 KB)
π
sysc_eventfd.stp
(4.86 KB)
π
sysc_execve.stp
(6.11 KB)
π
sysc_execveat.stp
(6.78 KB)
π
sysc_exit.stp
(1.54 KB)
π
sysc_exit_group.stp
(1.66 KB)
π
sysc_faccessat.stp
(3.2 KB)
π
sysc_fadvise64.stp
(7.43 KB)
π
sysc_fallocate.stp
(3.29 KB)
π
sysc_fanotify_init.stp
(3.02 KB)
π
sysc_fanotify_mark.stp
(5.75 KB)
π
sysc_fchdir.stp
(2.23 KB)
π
sysc_fchmod.stp
(2.52 KB)
π
sysc_fchmodat.stp
(3.2 KB)
π
sysc_fchown.stp
(3.28 KB)
π
sysc_fchown16.stp
(2.59 KB)
π
sysc_fchownat.stp
(3.24 KB)
π
sysc_fcntl.stp
(4.37 KB)
π
sysc_fdatasync.stp
(2.39 KB)
π
sysc_fgetxattr.stp
(2.94 KB)
π
sysc_finit_module.stp
(2.86 KB)
π
sysc_flistxattr.stp
(2.61 KB)
π
sysc_flock.stp
(2.28 KB)
π
sysc_fork.stp
(2.53 KB)
π
sysc_fremovexattr.stp
(2.73 KB)
π
sysc_fsetxattr.stp
(3.34 KB)
π
sysc_fstat.stp
(5.76 KB)
π
sysc_fstatat.stp
(5.21 KB)
π
sysc_fstatfs.stp
(2.94 KB)
π
sysc_fstatfs64.stp
(2.86 KB)
π
sysc_fsync.stp
(2.18 KB)
π
sysc_ftruncate.stp
(5.54 KB)
π
sysc_futex.stp
(5.11 KB)
π
sysc_futimesat.stp
(5.91 KB)
π
sysc_get_mempolicy.stp
(4.1 KB)
π
sysc_get_robust_list.stp
(4.12 KB)
π
sysc_getcpu.stp
(2.63 KB)
π
sysc_getcwd.stp
(2.43 KB)
π
sysc_getdents.stp
(5.18 KB)
π
sysc_getegid.stp
(3.46 KB)
π
sysc_geteuid.stp
(3.4 KB)
π
sysc_getgid.stp
(3.32 KB)
π
sysc_getgroups.stp
(3.91 KB)
π
sysc_gethostname.stp
(1.22 KB)
π
sysc_getitimer.stp
(4.87 KB)
π
sysc_getpeername.stp
(7.01 KB)
π
sysc_getpgid.stp
(2.6 KB)
π
sysc_getpgrp.stp
(2.04 KB)
π
sysc_getpid.stp
(1.98 KB)
π
sysc_getppid.stp
(2.06 KB)
π
sysc_getpriority.stp
(2.62 KB)
π
sysc_getrandom.stp
(2.72 KB)
π
sysc_getresgid.stp
(3.73 KB)
π
sysc_getresuid.stp
(3.54 KB)
π
sysc_getrlimit.stp
(4.08 KB)
π
sysc_getrusage.stp
(3.45 KB)
π
sysc_getsid.stp
(2.26 KB)
π
sysc_getsockname.stp
(7.03 KB)
π
sysc_getsockopt.stp
(7.88 KB)
π
sysc_gettid.stp
(2.01 KB)
π
sysc_gettimeofday.stp
(3.7 KB)
π
sysc_getuid.stp
(3.35 KB)
π
sysc_getxattr.stp
(3 KB)
π
sysc_init_module.stp
(2.76 KB)
π
sysc_inotify_add_watch.stp
(3.25 KB)
π
sysc_inotify_init.stp
(5.26 KB)
π
sysc_inotify_rm_watch.stp
(2.89 KB)
π
sysc_io_cancel.stp
(2.85 KB)
π
sysc_io_destroy.stp
(2.5 KB)
π
sysc_io_getevents.stp
(4.25 KB)
π
sysc_io_setup.stp
(3.43 KB)
π
sysc_io_submit.stp
(3.46 KB)
π
sysc_ioctl.stp
(3.12 KB)
π
sysc_ioperm.stp
(2.41 KB)
π
sysc_ioprio_get.stp
(2.65 KB)
π
sysc_ioprio_set.stp
(2.82 KB)
π
sysc_kcmp.stp
(2.51 KB)
π
sysc_kexec_file_load.stp
(3.35 KB)
π
sysc_kexec_load.stp
(3.96 KB)
π
sysc_keyctl.stp
(3.16 KB)
π
sysc_kill.stp
(2.25 KB)
π
sysc_lchown.stp
(3.34 KB)
π
sysc_lchown16.stp
(2.66 KB)
π
sysc_lgetxattr.stp
(3.05 KB)
π
sysc_link.stp
(2.34 KB)
π
sysc_linkat.stp
(3.26 KB)
π
sysc_listen.stp
(6.17 KB)
π
sysc_listxattr.stp
(2.72 KB)
π
sysc_llistxattr.stp
(2.78 KB)
π
sysc_llseek.stp
(2.81 KB)
π
sysc_lookup_dcookie.stp
(3.39 KB)
π
sysc_lremovexattr.stp
(3.11 KB)
π
sysc_lseek.stp
(3.98 KB)
π
sysc_lsetxattr.stp
(3.22 KB)
π
sysc_lstat.stp
(5.91 KB)
π
sysc_madvise.stp
(2.55 KB)
π
sysc_mbind.stp
(3.69 KB)
π
sysc_membarrier.stp
(2.65 KB)
π
sysc_memfd_create.stp
(2.77 KB)
π
sysc_migrate_pages.stp
(3.83 KB)
π
sysc_mincore.stp
(2.47 KB)
π
sysc_mkdir.stp
(2.38 KB)
π
sysc_mkdirat.stp
(2.92 KB)
π
sysc_mknod.stp
(2.45 KB)
π
sysc_mknodat.stp
(3.07 KB)
π
sysc_mlock.stp
(2.27 KB)
π
sysc_mlock2.stp
(2.47 KB)
π
sysc_mlockall.stp
(2.46 KB)
π
sysc_mmap2.stp
(5.45 KB)
π
sysc_modify_ldt.stp
(2.67 KB)
π
sysc_mount.stp
(3.53 KB)
π
sysc_move_pages.stp
(4.09 KB)
π
sysc_mprotect.stp
(2.55 KB)
π
sysc_mq_getsetattr.stp
(3.95 KB)
π
sysc_mq_notify.stp
(3.51 KB)
π
sysc_mq_open.stp
(4.54 KB)
π
sysc_mq_timedreceive.stp
(5.18 KB)
π
sysc_mq_timedsend.stp
(4.96 KB)
π
sysc_mq_unlink.stp
(2.53 KB)
π
sysc_mremap.stp
(3.01 KB)
π
sysc_msgctl.stp
(7.35 KB)
π
sysc_msgget.stp
(3.73 KB)
π
sysc_msgrcv.stp
(9.48 KB)
π
sysc_msgsnd.stp
(7.81 KB)
π
sysc_msync.stp
(2.44 KB)
π
sysc_munlock.stp
(2.39 KB)
π
sysc_munlockall.stp
(2.29 KB)
π
sysc_munmap.stp
(2.35 KB)
π
sysc_name_to_handle_at.stp
(3.46 KB)
π
sysc_nanosleep.stp
(5.22 KB)
π
sysc_nfsservctl.stp
(2.23 KB)
π
sysc_ni_syscall.stp
(1.4 KB)
π
sysc_nice.stp
(2.15 KB)
π
sysc_open.stp
(3.79 KB)
π
sysc_open_by_handle_at.stp
(3.8 KB)
π
sysc_openat.stp
(3.34 KB)
π
sysc_pause.stp
(2.5 KB)
π
sysc_perf_event_open.stp
(3.24 KB)
π
sysc_personality.stp
(2.74 KB)
π
sysc_pipe.stp
(9.86 KB)
π
sysc_pivot_root.stp
(2.71 KB)
π
sysc_poll.stp
(2.35 KB)
π
sysc_ppoll.stp
(5.38 KB)
π
sysc_prctl.stp
(2.48 KB)
π
sysc_pread.stp
(4.51 KB)
π
sysc_preadv.stp
(4.12 KB)
π
sysc_preadv2.stp
(4.48 KB)
π
sysc_prlimit64.stp
(2.97 KB)
π
sysc_process_vm_readv.stp
(4.08 KB)
π
sysc_process_vm_writev.stp
(4.13 KB)
π
sysc_pselect6.stp
(5.62 KB)
π
sysc_pselect7.stp
(3.58 KB)
π
sysc_ptrace.stp
(3.18 KB)
π
sysc_pwrite.stp
(6.27 KB)
π
sysc_pwritev.stp
(4.23 KB)
π
sysc_pwritev2.stp
(4.58 KB)
π
sysc_quotactl.stp
(4 KB)
π
sysc_read.stp
(3.29 KB)
π
sysc_readahead.stp
(3.02 KB)
π
sysc_readdir.stp
(3.6 KB)
π
sysc_readlink.stp
(2.59 KB)
π
sysc_readlinkat.stp
(3.24 KB)
π
sysc_readv.stp
(3.07 KB)
π
sysc_reboot.stp
(2.77 KB)
π
sysc_recv.stp
(6.7 KB)
π
sysc_recvfrom.stp
(7.82 KB)
π
sysc_recvmmsg.stp
(5.84 KB)
π
sysc_recvmsg.stp
(10.35 KB)
π
sysc_remap_file_pages.stp
(3.37 KB)
π
sysc_removexattr.stp
(2.75 KB)
π
sysc_rename.stp
(2.48 KB)
π
sysc_renameat.stp
(3.3 KB)
π
sysc_renameat2.stp
(3.61 KB)
π
sysc_request_key.stp
(3.23 KB)
π
sysc_restart_syscall.stp
(2.5 KB)
π
sysc_rmdir.stp
(2.25 KB)
π
sysc_rt_sigaction.stp
(6.2 KB)
π
sysc_rt_sigpending.stp
(4.35 KB)
π
sysc_rt_sigprocmask.stp
(7.87 KB)
π
sysc_rt_sigqueueinfo.stp
(4.26 KB)
π
sysc_rt_sigreturn.stp
(1.6 KB)
π
sysc_rt_sigsuspend.stp
(3.45 KB)
π
sysc_rt_sigtimedwait.stp
(5.08 KB)
π
sysc_rt_tgsigqueueinfo.stp
(3.92 KB)
π
sysc_sched_get_priority_max.stp
(3.26 KB)
π
sysc_sched_get_priority_min.stp
(3.26 KB)
π
sysc_sched_getaffinity.stp
(3.62 KB)
π
sysc_sched_getattr.stp
(3.05 KB)
π
sysc_sched_getparam.stp
(2.84 KB)
π
sysc_sched_getscheduler.stp
(2.94 KB)
π
sysc_sched_rr_get_interval.stp
(4.41 KB)
π
sysc_sched_setaffinity.stp
(3.49 KB)
π
sysc_sched_setattr.stp
(2.98 KB)
π
sysc_sched_setparam.stp
(2.83 KB)
π
sysc_sched_setscheduler.stp
(3.2 KB)
π
sysc_sched_yield.stp
(2.26 KB)
π
sysc_seccomp.stp
(2.76 KB)
π
sysc_select.stp
(5.55 KB)
π
sysc_semctl.stp
(7.22 KB)
π
sysc_semget.stp
(3.79 KB)
π
sysc_semop.stp
(4.73 KB)
π
sysc_semtimedop.stp
(8.8 KB)
π
sysc_send.stp
(6.81 KB)
π
sysc_sendfile.stp
(4.38 KB)
π
sysc_sendmmsg.stp
(8.61 KB)
π
sysc_sendmsg.stp
(11.48 KB)
π
sysc_sendto.stp
(7.66 KB)
π
sysc_set_mempolicy.stp
(3.69 KB)
π
sysc_set_robust_list.stp
(3.92 KB)
π
sysc_set_tid_address.stp
(2.83 KB)
π
sysc_setdomainname.stp
(3.04 KB)
π
sysc_setfsgid.stp
(4.43 KB)
π
sysc_setfsuid.stp
(4.48 KB)
π
sysc_setgid.stp
(4.23 KB)
π
sysc_setgroups.stp
(4.1 KB)
π
sysc_sethostname.stp
(2.72 KB)
π
sysc_setitimer.stp
(5.61 KB)
π
sysc_setns.stp
(2.34 KB)
π
sysc_setpgid.stp
(2.41 KB)
π
sysc_setpriority.stp
(2.79 KB)
π
sysc_setregid.stp
(5.84 KB)
π
sysc_setresgid.stp
(6.12 KB)
π
sysc_setresuid.stp
(6.13 KB)
π
sysc_setreuid.stp
(5.84 KB)
π
sysc_setrlimit.stp
(3.61 KB)
π
sysc_setsid.stp
(2.05 KB)
π
sysc_setsockopt.stp
(7.77 KB)
π
sysc_settimeofday.stp
(6.01 KB)
π
sysc_setuid.stp
(4.23 KB)
π
sysc_setxattr.stp
(3.12 KB)
π
sysc_sgetmask.stp
(2.12 KB)
π
sysc_shmat.stp
(5.88 KB)
π
sysc_shmctl.stp
(7.23 KB)
π
sysc_shmdt.stp
(3.36 KB)
π
sysc_shmget.stp
(3.7 KB)
π
sysc_shutdown.stp
(6.46 KB)
π
sysc_sigaction.stp
(5.2 KB)
π
sysc_sigaltstack.stp
(3.83 KB)
π
sysc_signal.stp
(2.5 KB)
π
sysc_signalfd.stp
(11.53 KB)
π
sysc_sigpending.stp
(3.19 KB)
π
sysc_sigprocmask.stp
(3.69 KB)
π
sysc_sigreturn.stp
(1.43 KB)
π
sysc_sigsuspend.stp
(4.22 KB)
π
sysc_socket.stp
(6.92 KB)
π
sysc_socketpair.stp
(7.68 KB)
π
sysc_splice.stp
(2.78 KB)
π
sysc_ssetmask.stp
(2.49 KB)
π
sysc_stat.stp
(5.91 KB)
π
sysc_statfs.stp
(3.02 KB)
π
sysc_statfs64.stp
(2.93 KB)
π
sysc_statx.stp
(3.4 KB)
π
sysc_stime.stp
(2.76 KB)
π
sysc_swapoff.stp
(2.41 KB)
π
sysc_swapon.stp
(2.6 KB)
π
sysc_symlink.stp
(2.52 KB)
π
sysc_symlinkat.stp
(3.28 KB)
π
sysc_sync.stp
(1.88 KB)
π
sysc_sync_file_range.stp
(4.76 KB)
π
sysc_syncfs.stp
(2.27 KB)
π
sysc_sysctl.stp
(2.78 KB)
π
sysc_sysfs.stp
(3.22 KB)
π
sysc_sysinfo.stp
(2.95 KB)
π
sysc_syslog.stp
(2.41 KB)
π
sysc_tee.stp
(2.3 KB)
π
sysc_tgkill.stp
(2.48 KB)
π
sysc_time.stp
(3.18 KB)
π
sysc_timer_create.stp
(4.39 KB)
π
sysc_timer_delete.stp
(2.61 KB)
π
sysc_timer_getoverrun.stp
(2.86 KB)
π
sysc_timer_gettime.stp
(4.15 KB)
π
sysc_timer_settime.stp
(5.33 KB)
π
sysc_timerfd.stp
(1.79 KB)
π
sysc_timerfd_create.stp
(2.99 KB)
π
sysc_timerfd_gettime.stp
(3.79 KB)
π
sysc_timerfd_settime.stp
(4.71 KB)
π
sysc_times.stp
(2.84 KB)
π
sysc_tkill.stp
(2.35 KB)
π
sysc_truncate.stp
(5.25 KB)
π
sysc_tux.stp
(1.04 KB)
π
sysc_umask.stp
(2.22 KB)
π
sysc_umount.stp
(4.5 KB)
π
sysc_uname.stp
(4.77 KB)
π
sysc_unlink.stp
(2.38 KB)
π
sysc_unlinkat.stp
(2.79 KB)
π
sysc_unshare.stp
(2.48 KB)
π
sysc_uselib.stp
(2.39 KB)
π
sysc_userfaultfd.stp
(2.68 KB)
π
sysc_ustat.stp
(4.77 KB)
π
sysc_utime.stp
(5.37 KB)
π
sysc_utimensat.stp
(6.16 KB)
π
sysc_utimes.stp
(5.29 KB)
π
sysc_vfork.stp
(1.98 KB)
π
sysc_vhangup.stp
(2.08 KB)
π
sysc_vmsplice.stp
(5.56 KB)
π
sysc_wait4.stp
(4.55 KB)
π
sysc_waitid.stp
(3.68 KB)
π
sysc_waitpid.stp
(3.02 KB)
π
sysc_write.stp
(3.5 KB)
π
sysc_writev.stp
(3.22 KB)
π
syscall_any.stp
(1.52 KB)
π
syscall_table.stp
(1.44 KB)
π
syscalls.stpm
(13.78 KB)
π
syscalls_cfg_trunc.stp
(111 B)
π
target_set.stp
(1.73 KB)
π
task.stp
(22.21 KB)
π
task.stpm
(253 B)
π
task_ancestry.stp
(1.58 KB)
π
task_time.stp
(7.68 KB)
π
tcp.stp
(22.11 KB)
π
tcpmib-filter-default.stp
(885 B)
π
tcpmib.stp
(10.57 KB)
π
timestamp.stp
(1.72 KB)
π
timestamp_gtod.stp
(1.59 KB)
π
timestamp_monotonic.stp
(5.46 KB)
π
tty.stp
(7.18 KB)
π
tzinfo.stp
(803 B)
π
ucontext-symbols.stp
(8.63 KB)
π
ucontext-unwind.stp
(3.64 KB)
π
ucontext.stp
(2.18 KB)
π
udp.stp
(5.95 KB)
π
utrace.stp
(1.33 KB)
π
vfs.stp
(32.43 KB)
π
x86_64
Editing: ctime.stp
/* ctime.stp - Convert seconds to human readable date string. * * This code was adapted from the newlib mktm_r() and asctime_r() * functions. In newlib, mktm_r.c states that it was adapted from * tzcode maintained by Arthur David Olson. In newlib, asctime_r.c * doesn't have any author/copyright information. * * Changes copyright (C) 2006-2016 Red Hat Inc. */ /** * sfunction ctime - Convert seconds since epoch into human readable date/time string * * @epochsecs: Number of seconds since epoch (as returned by gettimeofday_s()) * * Description: Takes an argument of seconds since the epoch as returned by * gettimeofday_s(). Returns a string of the form * * "Wed Jun 30 21:49:08 1993" * * The string will always be exactly 24 characters. If the time would * be unreasonable far in the past (before what can be represented * with a 32 bit offset in seconds from the epoch) an error will occur * (which can be avoided with try/catch). If the time would be * unreasonable far in the future, an error will also occur. * * Note that the epoch (zero) corresponds to * * "Thu Jan 1 00:00:00 1970" * * The earliest full date given by ctime, corresponding to epochsecs * -2147483648 is "Fri Dec 13 20:45:52 1901". The latest full date * given by ctime, corresponding to epochsecs 2147483647 is * "Tue Jan 19 03:14:07 2038". * * The abbreviations for the days of the week are βSunβ, βMonβ, βTueβ, * βWedβ, βThuβ, βFriβ, and βSatβ. The abbreviations for the months * are βJanβ, βFebβ, βMarβ, βAprβ, βMayβ, βJunβ, βJulβ, βAugβ, βSepβ, * βOctβ, βNovβ, and βDecβ. * * Note that the real C library ctime() function puts a newline ('\n') * character at the end of the string that this function does not. * Also note that since the kernel has no concept of timezones, the * returned time is always in GMT. */ function ctime:string(epochsecs:long) %{ /* pure */ #define SECSPERMIN 60L #define MINSPERHOUR 60L #define HOURSPERDAY 24L #define SECSPERHOUR (SECSPERMIN * MINSPERHOUR) #define SECSPERDAY (SECSPERHOUR * HOURSPERDAY) #define DAYSPERWEEK 7 #define MONSPERYEAR 12 #define EPOCH_YEAR 1970 #define EPOCH_WDAY 4 #define isleap(y) ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0) static const int mon_lengths[2][MONSPERYEAR] = { {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31} } ; static const int year_lengths[2] = { 365, 366 } ; static const char day_name[7][3] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; static const char mon_name[12][3] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; long days, rem; time_t lcltime; int yleap; const int *ip; int tm_sec; /* seconds */ int tm_min; /* minutes */ int tm_hour; /* hours */ int tm_mday; /* day of the month */ int tm_mon; /* month */ int tm_year; /* year */ int tm_wday; /* day of the week */ // Check that the numer of seconds is "reasonable". // Otherwise (especially on 64bit machines) we will be spending // way too much time calculating the correct year, month and // day. Also we would like the returned string to always be 24 chars. // So cap to what can be represented normally on a 32bit machine. int64_t MAX_POS_SECS = 2147483647LL; int64_t MIN_NEG_SECS = -2147483648LL; if (STAP_ARG_epochsecs > MAX_POS_SECS) { #if STAP_COMPAT_VERSION <= STAP_VERSION(2,2) strlcpy(STAP_RETVALUE, "far far in the future...", MAXSTRINGLEN); #else CONTEXT->last_error = "Time too far in the future to be converted"; #endif return; } if (STAP_ARG_epochsecs < MIN_NEG_SECS) { #if STAP_COMPAT_VERSION <= STAP_VERSION(2,2) strlcpy(STAP_RETVALUE, "a long, long time ago...", MAXSTRINGLEN); #else CONTEXT->last_error = "Time too far in the past to be converted"; #endif return; } lcltime = STAP_ARG_epochsecs; days = ((long)lcltime) / SECSPERDAY; rem = ((long)lcltime) % SECSPERDAY; while (rem < 0) { rem += SECSPERDAY; --days; } while (rem >= SECSPERDAY) { rem -= SECSPERDAY; ++days; } /* compute hour, min, and sec */ tm_hour = (int) (rem / SECSPERHOUR); rem %= SECSPERHOUR; tm_min = (int) (rem / SECSPERMIN); tm_sec = (int) (rem % SECSPERMIN); /* compute day of week */ if ((tm_wday = ((EPOCH_WDAY + days) % DAYSPERWEEK)) < 0) tm_wday += DAYSPERWEEK; /* compute year & day of year */ tm_year = EPOCH_YEAR; if (days >= 0) { for (;;) { yleap = isleap(tm_year); if (days < year_lengths[yleap]) break; tm_year++; days -= year_lengths[yleap]; } } else { do { --tm_year; yleap = isleap(tm_year); days += year_lengths[yleap]; } while (days < 0); } ip = mon_lengths[yleap]; for (tm_mon = 0; days >= ip[tm_mon]; ++tm_mon) days -= ip[tm_mon]; tm_mday = days + 1; /* * At this point we have all our information. Now we need to * convert it to an ascii representation. */ snprintf (STAP_RETVALUE, MAXSTRINGLEN, "%.3s %.3s%3d %.2d:%.2d:%.2d %d", day_name[tm_wday], mon_name[tm_mon], tm_mday, tm_hour, tm_min, tm_sec, tm_year); %} /** * sfunction ctime - Convert seconds since epoch into human readable date/time string * * Without an argument, does the same as ctime(gettimeofday_s()). * */ function ctime:string() { return ctime(gettimeofday_s()) }
Upload File
Create Folder