1270631Sjfv/* 2270631Sjfv * time.h - DTrace Time include file. 3292095Ssmh * 4270631Sjfv * $Id: time.h 36 2007-09-15 06:51:18Z brendan $ 5270631Sjfv * 6270631Sjfv * COPYRIGHT: Copyright (c) 2007 Brendan Gregg. 7270631Sjfv * 8270631Sjfv * CDDL HEADER START 9270631Sjfv * 10270631Sjfv * The contents of this file are subject to the terms of the 11270631Sjfv * Common Development and Distribution License, Version 1.0 only 12270631Sjfv * (the "License"). You may not use this file except in compliance 13270631Sjfv * with the License. 14270631Sjfv * 15270631Sjfv * You can obtain a copy of the license at Docs/cddl1.txt 16270631Sjfv * or http://www.opensolaris.org/os/licensing. 17270631Sjfv * See the License for the specific language governing permissions 18270631Sjfv * and limitations under the License. 19270631Sjfv * 20270631Sjfv * CDDL HEADER END 21270631Sjfv * 22270631Sjfv * 16-Sep-2007 Brendan Gregg Created this. 23270631Sjfv */ 24270631Sjfv 25270631Sjfv/* 26270631Sjfv * TIME_HHMMSS - Returns GMT time as a "HH:MM:SS" string. 27270631Sjfv * 28270631Sjfv * eg, "21:53:07" 29270631Sjfv */ 30270631Sjfv#define TIME_HHMMSS \ 31270631Sjfv strjoin(strjoin(strjoin(strjoin(strjoin( \ 32270631Sjfv (((walltimestamp / 1000000000) % 86400) / 3600) < 10 ? "0" : "",\ 33270631Sjfv lltostr(((walltimestamp / 1000000000) % 86400) / 3600)), ":"), \ 34270631Sjfv strjoin((((walltimestamp / 1000000000) % 3600) / 60) < 10 ? \ 35292095Ssmh "0" : "", lltostr(((walltimestamp / 1000000000) % 3600) / 60))),\ 36270631Sjfv ":"), strjoin(((walltimestamp / 1000000000) % 60) < 10 ? \ 37270631Sjfv "0" : "", lltostr((walltimestamp / 1000000000) % 60))) 38292095Ssmh 39292095Ssmh