10 #include "xgi/Method.h"
11 #include "xgi/Utils.h"
13 #include "cgicc/Cgicc.h"
14 #include "cgicc/FormEntry.h"
15 #include "cgicc/HTMLClasses.h"
20 #include "boost/tokenizer.hpp"
23 #include <sys/types.h>
30 const std::string ExceptionGenerator::menu[menu_items] =
31 {
"Sleep x ms",
"SleepForever",
"Cms Exception",
"Exit with error",
"Abort",
"Unknown Exception",
"Endless loop",
"Generate Error Message",
"Segfault",
32 "Burn CPU",
"HLT timing distribution",
"HLT timing with memory access",
"Timed segfault",
"Invalid free()"};
36 actionId_(pset.getUntrackedParameter<int>(
"defaultAction",-1)),
37 intqualifier_(pset.getUntrackedParameter<int>(
"defaultQualifier",0)),
38 actionRequired_(actionId_!=-1)
49 timingHisto_ =
new TH1D(
"timingHisto_",
"Total time for all modules per event",100,0,1000);
160 unsigned int iterations = 0;
187 while(1){ind+=
step;
if(ind>1000000) step = -1;
if(ind==0) step = 1;}
201 iterations =
static_cast<unsigned int>(
204 for(
unsigned int j=0;
j<iterations;
j++){
210 iterations =
static_cast<unsigned int>(
213 TRandom3
random(iterations);
214 const size_t dataSize = 32*500;
215 std::vector<double>
data(dataSize);
216 random.RndmArray(dataSize, &data[0]);
218 for(
unsigned int j=0;
j<iterations;
j++){
219 const size_t index =
static_cast<size_t>(random.Rndm() * dataSize + 0.5);
222 if ( random.Rndm() < 0.1 )
230 gettimeofday(&tv_now,0);
231 if (tv_now.tv_sec-
tv_start_.tv_sec>intqualifier_)
236 void *vp = malloc(1024);
237 memset((
char *)vp - 32, 0, 1024);
258 cgicc::Cgicc cgi(in);
259 if ( xgi::Utils::hasFormElement(cgi,
"exceptiontype") )
261 actionId_ = xgi::Utils::getFormElement(cgi,
"exceptiontype")->getIntegerValue();
263 qualifier_ = xgi::Utils::getFormElement(cgi,
"qualifier")->getValue();
264 intqualifier_ = xgi::Utils::getFormElement(cgi,
"qualifier")->getIntegerValue();
271 if ( xgi::Utils::hasFormElement(cgi,
"module") )
272 mname = xgi::Utils::getFormElement(cgi,
"module")->getValue();
273 cgicc::CgiEnvironment cgie(in);
276 path = cgie.getPathInfo();
277 query = cgie.getQueryString();
289 *out <<
"<html>" << endl;
290 *out <<
"<head>" << endl;
293 *out <<
"<STYLE type=\"text/css\"> #T1 {border-width: 2px; border: solid blue; text-align: center} </STYLE> " << endl;
294 *out <<
"<link type=\"text/css\" rel=\"stylesheet\"";
295 *out <<
" href=\"/" << urn
296 <<
"/styles.css\"/>" << endl;
299 <<
" MAIN</title>" << endl;
301 *out <<
"</head>" << endl;
302 *out <<
"<body onload=\"loadXMLDoc()\">" << endl;
303 *out <<
"<table border=\"0\" width=\"100%\">" << endl;
304 *out <<
"<tr>" << endl;
305 *out <<
" <td align=\"left\">" << endl;
306 *out <<
" <img" << endl;
307 *out <<
" align=\"middle\"" << endl;
308 *out <<
" src=\"/evf/images/systemerror.jpg\"" << endl;
309 *out <<
" alt=\"main\"" << endl;
310 *out <<
" width=\"90\"" << endl;
311 *out <<
" height=\"64\"" << endl;
312 *out <<
" border=\"\"/>" << endl;
313 *out <<
" <b>" << endl;
315 *out <<
" </b>" << endl;
316 *out <<
" </td>" << endl;
317 *out <<
" <td width=\"32\">" << endl;
318 *out <<
" <a href=\"/urn:xdaq-application:lid=3\">" << endl;
319 *out <<
" <img" << endl;
320 *out <<
" align=\"middle\"" << endl;
321 *out <<
" src=\"/hyperdaq/images/HyperDAQ.jpg\"" << endl;
322 *out <<
" alt=\"HyperDAQ\"" << endl;
323 *out <<
" width=\"32\"" << endl;
324 *out <<
" height=\"32\"" << endl;
325 *out <<
" border=\"\"/>" << endl;
326 *out <<
" </a>" << endl;
327 *out <<
" </td>" << endl;
328 *out <<
" <td width=\"32\">" << endl;
329 *out <<
" </td>" << endl;
330 *out <<
" <td width=\"32\">" << endl;
332 *out <<
" <img" << endl;
333 *out <<
" align=\"middle\"" << endl;
334 *out <<
" src=\"/evf/images/spoticon.jpg\"" << endl;
335 *out <<
" alt=\"main\"" << endl;
336 *out <<
" width=\"32\"" << endl;
337 *out <<
" height=\"32\"" << endl;
338 *out <<
" border=\"\"/>" << endl;
339 *out <<
" </a>" << endl;
340 *out <<
" </td>" << endl;
341 *out <<
"</tr>" << endl;
342 *out <<
"</table>" << endl;
344 *out <<
"<hr/>" << endl;
346 *out << cgicc::form().set(
"method",
"GET").set(
"action", path )
348 boost::char_separator<char> sep(
"&");
349 boost::tokenizer<boost::char_separator<char> > tokens(query, sep);
350 for (
boost::tokenizer<boost::char_separator<char> >::iterator tok_iter = tokens.begin();
351 tok_iter != tokens.end(); ++tok_iter){
352 size_t pos = (*tok_iter).find_first_of(
"=");
353 if(pos != std::string::npos){
354 std::string
first = (*tok_iter).substr(0 , pos);
355 std::string
second = (*tok_iter).substr(pos+1, (*tok_iter).length()-pos-1);
356 *out <<
cgicc::input().set(
"type",
"hidden").set(
"name",first).set(
"value", second)
361 *out <<
"Select " << endl;
362 *out <<
cgicc::select().set(
"name",
"exceptiontype") << std::endl;
367 sprintf(istring,
"%d",
i);
368 *out << cgicc::option().set(
"value",istring) <<
menu[
i] << cgicc::option() << std::endl;
371 *out <<
"<br>" << endl;
372 *out <<
"Qualifier" << endl;
373 *out <<
cgicc::input().set(
"type",
"text").set(
"name",
"qualifier") << std::endl;
374 *out <<
cgicc::input().set(
"type",
"submit").set(
"value",
"Do It !") << std::endl;
375 *out << cgicc::form() << std::endl;
377 *out <<
"</body>" << endl;
378 *out <<
"</html>" << endl;
virtual void publishForkInfo(moduleweb::ForkInfoObj *forkInfoObj)
boost::tokenizer< boost::char_separator< char > > tokenizer
void defaultWebPage(xgi::Input *in, xgi::Output *out)
unsigned int intqualifier_
void publish(xdata::InfoSpace *)
U second(std::pair< T, U > const &p)
void analyze(const edm::Event &e, const edm::EventSetup &c)
std::string original_referrer_
static const int menu_items
void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
static const std::string menu[menu_items]
char data[epos_bytes_allocation]
void beginRun(edm::Run &r, const edm::EventSetup &iSetup)