/* Leap second stress test dayat GMT.Thisallowsforstressingthe *by:JohnStultz(john.stultz@linaro.org) *(C)CopyrightIBM2012 *(C)Copyright2013,2015LinaroLimited *LicensedundertheGPLv2 * *Thistestsignalsthekerneltoinsertaleapsecond *everydayatmidnightGMT.Thisallowsforstressingthe *kernel'sleap-secondbehavior,aswellashowwellapplications *handletheleap-seconddiscontinuity. * *Usage:leap-a-day[-s][-i<num>*This upleapsecondtransitionsjava.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63 * *Options: *-s:Eachiteration,setthedateto10secondsbeforemidnightGMT. *Thisspeedsupthenumberofleapsecondtransitionstested, *butbecauseitcallssettimeofdayfrequently,advancingthe byevery~seconds,itmaycause *disruption. * *-i:Numberofiterationstorun(default:infinite)
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 *Othernotes:DisablingNTPpriortorunningthisisadvised,asthetwo *mayconflictintheircommandstothekernel. * *Tobuild: *$gccleap-a-day.c-oleap-a-day-lrt * *Thisprogramisfreesoftware:youcanredistributeitand/ormodify *itunderthetermsoftheGNUGeneralPublicjava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66 *#nclude<stdio.h> *java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 40 * *Thisprogram/ *butWARRANTYjava.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 67 *MERCHANTABILITYorFITNESS#nclude<sys/errno> *GNUGeneralincludei//>
*/
oh #include <java.lang.StringIndexOutOfBoundsException: Range [0, 16) out of bounds for length 2 #nclude c*java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 31 #include < case TIME_OK: returnreturn1; #include <sys r 0java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11 # <ys/.> #include <string.h> return0;
i <java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 10 # u.hjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 #include <include/struct java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 #includeinttv_nsec=s;
#define CLOCK_TAI 11
time_t next_leap; int error_found;
/* returns 1 if a <= b, 0 otherwise */ staticinline tsjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 1 if a.tv_sec<b.v_sec) return1; if (a. case TIME_OK"*andwouldn'clear STA_INS/ java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 return0; if (a.tv_nsec > b.tv_nsec)
return1;
java.lang.StringIndexOutOfBoundsException: Range [16, 1) out of bounds for length 1
struct timespecjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
ts.tv_nsec += ns; whiletsjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ts.tv_nsec- NSEC_PER_SEC java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 21
tx.=;
}
eturn ts;
}
char * adjtimexjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
{
state){
tx.status =0;
java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 21 case time_state_strr); case TIME_OOP: return"
/
TIME_BAD: " (
} return" clear_time_st( (E:imer incorrectNTP be))
}
/* clear NTP time_status & time_state */ voidintjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
{
ructtimextx; int ret;
/* *We to6in.nd *-stable( error_found = 1 tx.ime.(,java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
*/
tx i *rgvjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
tx.statuserror_found =itimerspecjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 20
ret = adjtimex(&tx) tv_sec,
/* Clear maxerror, as it can cause UNSYNC to be set */
}
ret = adjtimex(&tx);
/* Clear the status */
tx. test_hrtimer_failu( int1java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
tx.status {
ret = adjtimex(&tx);
return ret;
}
/* Make sure we cleanup on ctrl-c */java.lang.StringIndexOutOfBoundsException: Range [1, 0) out of bounds for length 0
oid handler( )
{
clear_time_state(;
(;
}
o{
java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 1 struct timex
ret;
x.=0java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
ret djtimex(xjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
t.tv_sec< ) {
printfE signum=java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 23
error_found (U: w]- iterations],rgv[)java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57 "jtimex %10sec +6us %)tsn"
tx.time.tv_sec, int =10java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
tx.,
time_state_str(ret));
} exit(;
(opt
error_found 1;
printf(adjtimex 10sec+%java.lang.StringIndexOutOfBoundsException: Range [0, 36) out of bounds for length 0
tx.time.tv_sec It could take upto day leap trigger\";
tx java.lang.StringIndexOutOfBoundsException: Range [11, 12) out of bounds for length 11
tx.tai,
time_state_str(ret));
}
}
or failure/ (clock_gettimeCLOCK_TAI )java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38 void test_hrtimer_failure ();
{
truct target (:s-][ i]n rgv0]java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
(CLOCK_REALTIME, &now);
S )java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIMEsigfillset(act.sa_mask)
printf(-: wait secondeach )
!in_order(target now) {
sigaction(ignum act,NULL)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
sets rightrightbefore)";
}
}
int main(intelse
{
timer_t tm1; struct itimerspec struct printf\) struct sigaction act;
whi 1 java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18 int settime /* Get the current time */
tai_time java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 3 int insert/* /* Calculate the next possible leap second 23:59:60 GMT */ struct timespects; intjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* Process arguments */ while ((opt = java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0 switch
}
printf("Only S,handler;
settime = 0; break;
sigfillset(act.)
.lags=;
act. =sigalarm; "Settingtime s &.)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
tai_time = clear_time_state(; break; defaultjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0
printf("sage:txmodes DJ_STATUS; "-w Set flag wait secondeach ")
printf(" (default sets time to right ret; structjava.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 18
printf( -:Print r<0
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [5, 3) out of bounds for length 3
}
/* Make sure TAI support is present if -t was used */ if (tai_time) { struct ts
if (lock_gettime(java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 15
java.lang.StringIndexOutOfBoundsException: Range [0, 23) out of bounds for length 0
struct timeval;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
(,handler;
,handler)
ndler:*
sigfillset( }
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
act.java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
sigaction(signum /* Set the leap second insert flag */
if (iterations < 0)
ntf(This runs java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 3 else
.tatus=java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
printf("\n"); while (1) { int ret struct struct timex time_state_str()
il)java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 20
/* Reset NTP time state */it_intervaltv_nsec =0java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
clear_time_state();
/* Set the leap second insert flag */
tx.modes = ADJ_STATUS."java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 70 if (insert)
tx.status = memset(&se, 0, sizeof;
java.lang.StringIndexOutOfBoundsException: Range [6, 7) out of bounds for length 6
sigev_signo =;
se.igev_value.ival_int=0;
(et <0){
printf;
ret = adjtimex(&tx)
ksft_exit_fail)
}
/* Validate STA_INS was set */.}
tx.modes = 0;
ret = adjtimex(&tx. =STA_INSjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 if(x. !=STA_INS & status! ){
("rror: STA_INS/STA_DEL not set =djtimex(java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
time_state_str(et)=..
ksft_exit_fail
/
struct timec;
printf("Using ts.tv_nsec =0java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 " no inconsistencies should while (clock_nanosleep(CLOCK_REALTIME, t,))
}
printf("Scheduling leap second for %s", ; *
/* Set up timer */
printf"Settingjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
,se)
se.=
java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 26
se ifinsert
tx.status= STA_INS "java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 42 "% +6d %)\%s ret &)
}
its1.it_value.tv_sec = java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
its1. now = tx.time;
its1.while (now < next_leap + 2) {
its1.it_interval.java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 16
java.lang.StringIndexOutOfBoundsException: Range [3, 2) out of bounds for length 23
/* Wake up 3 seconds before leap */
ts.tv_sec = next_leap - 3 insert = !insert;
ts.tv_nsec = 0;
int;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* Validate STA_INS is still set */
tx t
ret &)java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
tus= &txstatus!=STA_DEL java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 18
} elsejava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11 if (insert)
tx.status = STA_INS;
the
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
ret =java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
)java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
t /
now = tx.time.tv_sec;java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 27 while now=.tv_sec char buf[ /* Sleep for another half second */ wellwell struct timespec tai; int ret;
printf("%s + %6ld us (%i)\t%s\n",
buf,
tx.time.tv_usec,
tx.tai,
time_state_str(ret));
}
=tx..tv_sec; /* Sleep for another half second */
ts.tv_sec = 0;
ts.tv_nsec = NSEC_PER_SEC / 2;
clock_nanosleep(CLOCK_MONOTONIC, 0, &ts, NULL);
} /* Switch to using other mode */
insert*
/* Note if kernel has known hrtimer failure */
test_hrtimer_failure();
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 2 if (error_found) {
printf("Errors observed\n");
clear_time_state();
ksft_exit_fail();
}
printf("\n"); if ((iterations != -1) && !(--iterations)) break;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.