1235368Sgnn/* 2235368Sgnn * time.h - DTrace Time include file. 3235368Sgnn * 4235368Sgnn * $Id: time.h 36 2007-09-15 06:51:18Z brendan $ 5235368Sgnn * 6235368Sgnn * COPYRIGHT: Copyright (c) 2007 Brendan Gregg. 7235368Sgnn * 8235368Sgnn * CDDL HEADER START 9235368Sgnn * 10235368Sgnn * The contents of this file are subject to the terms of the 11235368Sgnn * Common Development and Distribution License, Version 1.0 only 12235368Sgnn * (the "License"). You may not use this file except in compliance 13235368Sgnn * with the License. 14235368Sgnn * 15235368Sgnn * You can obtain a copy of the license at Docs/cddl1.txt 16235368Sgnn * or http://www.opensolaris.org/os/licensing. 17235368Sgnn * See the License for the specific language governing permissions 18235368Sgnn * and limitations under the License. 19235368Sgnn * 20235368Sgnn * CDDL HEADER END 21235368Sgnn * 22235368Sgnn * 16-Sep-2007 Brendan Gregg Created this. 23235368Sgnn */ 24235368Sgnn 25235368Sgnn/* 26235368Sgnn * TIME_HHMMSS - Returns GMT time as a "HH:MM:SS" string. 27235368Sgnn * 28235368Sgnn * eg, "21:53:07" 29235368Sgnn */ 30235368Sgnn#define TIME_HHMMSS \ 31235368Sgnn strjoin(strjoin(strjoin(strjoin(strjoin( \ 32235368Sgnn (((walltimestamp / 1000000000) % 86400) / 3600) < 10 ? "0" : "",\ 33235368Sgnn lltostr(((walltimestamp / 1000000000) % 86400) / 3600)), ":"), \ 34235368Sgnn strjoin((((walltimestamp / 1000000000) % 3600) / 60) < 10 ? \ 35235368Sgnn "0" : "", lltostr(((walltimestamp / 1000000000) % 3600) / 60))),\ 36235368Sgnn ":"), strjoin(((walltimestamp / 1000000000) % 60) < 10 ? \ 37235368Sgnn "0" : "", lltostr((walltimestamp / 1000000000) % 60))) 38235368Sgnn 39