50 fStartTime.Set(st.
Atoi());
88 const char *fname,
const char *pattern)
92 Error(
"Retrieve",
"option 'Grep' requires a pattern");
100 Int_t nd = 0, nb = 0;
103 if (ord[0] ==
'*' || !strcmp(ord, ple->
GetName())) {
104 if (ple->
Retrieve(opt, pattern) != 0) {
110 msg.
Form(
"Retrieving logs: %d ok, %d not ok (%.0f%% processed)\r", nd, nb, frac);
137 msg.
Form(
"\n// --------- Displaying PROOF Session logs --------\n" 138 "// Server: %s \n// Session: %s \n// # of elements: %d \n" 139 "// ------------------------------------------------\n\n",
147 if (ord[0] ==
'*' || !strcmp(ord, ple->
GetName()))
152 Prt(
"// --------- End of PROOF Session logs ---------\n");
162 fprintf(stderr,
"// --------- PROOF Session logs object --------\n");
163 fprintf(stderr,
"// Server: %s \n",
GetTitle());
164 fprintf(stderr,
"// Session: %s \n",
GetName());
165 fprintf(stderr,
"// # of elements: %d \n", nel);
166 fprintf(stderr,
"// --------------------------------------------\n");
175 fprintf(stderr,
"// --------------------------------------------\n");
188 FILE *where = (
fFILE) ? (FILE *)
fFILE : stderr;
190 if (newline) fputc(
'\n', where);
205 Warning(
"Save",
"filename undefined - do nothing");
215 fout = fopen(fname,
"a");
217 fout = fopen(fname,
"w");
220 Warning(
"Save",
"file could not be opened - do nothing");
223 fFILE = (
void *) fout;
229 msg.
Form(
"\n// --------- Displaying PROOF Session logs --------\n" 230 "// Server: %s \n// Session: %s \n// # of elements: %d \n" 231 "// ------------------------------------------------\n\n",
240 if (ord[0] ==
'*' || !strcmp(ord, ple->
GetName()))
246 Prt(
"// --------- End of PROOF Session logs ---------\n");
263 if (!txt || strlen(txt) <= 0) {
264 Warning(
"Grep",
"text to be searched for is undefined - do nothing");
271 msg.
Form(
"\n// --------- Search in PROOF Session logs --------\n" 272 "// Server: %s \n// Session: %s \n// # of elements: %d \n" 276 msg.
Form(
"// starting from line %d \n", from);
281 Prt(
"// ------------------------------------------------\n");
295 Prt(
"// ------------------------------------------------\n");
329 if (strstr(
GetTitle(),
"worker-")) {
378 Warning(
"Retrieve",
"No reference manager: corruption?");
384 Info(
"Retrieve",
"Retrieving from ordinal %s file %s with pattern %s",
394 Info(
"Retrieve",
"Retrieving the whole file");
400 Info(
"Retrieve",
"Retrieving the leading %lld lines of file",
fTo);
403 if (!pattern || strlen(pattern) <= 0) {
404 Error(
"Retrieve",
"option 'Grep' requires a pattern");
408 Info(
"Retrieve",
"Retrieving only lines filtered with %s", pattern);
414 Info(
"Retrieve",
"Retrieving the last %lld lines of file", -
fFrom);
428 if (fileName.
Contains(
"__igprof.pp__")) {
431 Info(
"Retrieve",
"Retrieving analyzed IgProf performance profile");
433 "|( T=`mktemp` && cat > \"$T\" ; igprof-analyse -d -g \"$T\" ; rm -f \"$T\" )";
434 if (pattern && (*pattern ==
'|'))
435 analyzeAndFilter.
Append(pattern);
474 Int_t ie = (to > -1 && to < nls) ? to : nls;
478 }
else if (from < 0) {
486 Prt(
"// --------- Start of element log -----------------\n");
491 Int_t ic = path.Index(
",");
494 path.Remove(0, ic+1);
496 msg.
Form(
"// Submaster: %s \n", subm.
Data());
499 msg.
Form(
"// Path: %s \n// # of retrieved lines: %d ", path.Data(), nls);
501 if (i > 0 || ie < nls) {
502 msg.
Form(
"(displaying lines: %d -> %d)\n", i+1, ie);
507 Prt(
"// ------------------------------------------------\n");
517 if (msg.
Length() < 100000) {
518 if (msg.
Length() > 0) msg +=
"\n";
519 msg += os->GetName();
530 Prt(
"// --------- End of element log -------------------\n\n");
540 const char *role = (strstr(
GetTitle(),
"worker-")) ?
"worker" :
"master";
542 fprintf(stderr,
"Ord: %s Host: Role: %s lines: %d\n",
GetName(), role, nls);
565 Int_t i = (from > 0) ? (from - 1) : 0;
566 for( ; i < nls; i++) {
569 if (strstr(os->
GetName(), txt)) {
void Prt(const char *what, Bool_t newline=kTRUE)
Special printing procedure.
virtual const char * GetName() const
Returns name of object.
TList * GetListOfLines() const
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
void Prt(const char *what)
Special printing procedure.
static void SetMaxTransferSize(Long64_t maxsz)
Set max transfer size.
Collectable string class.
static Long64_t fgMaxTransferSize
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
The PROOF manager interacts with the PROOF server coordinator to create or destroy a PROOF session...
virtual ~TProofLog()
Destructor.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Class supporting a collection of lines with C++ code.
void ToLower()
Change string to lower-case.
void EmitVA(const char *signal_name, Int_t, const T &... params)
Emit a signal with a varying number of arguments.
void Display(const char *ord="*", Int_t from=-10, Int_t to=-1)
Display the content associated with worker 'ord' from line 'from' to line 'to' inclusive.
void Display(Int_t from=0, Int_t to=-1)
Display the current content starting from line 'from' to line 'to' inclusive.
void Print(Option_t *opt=0) const
Print a line with the relevant info.
The TNamed class is the base class for all named ROOT classes.
Int_t Grep(const char *txt, TString &res, Int_t from=0)
Search lines containing 'txt', starting from line 'from'.
TString & Append(const char *cs)
static void SetMaxTransferSize(Long64_t maxsz)
Set max transfer size.
const char * GetName() const
Returns name of object.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual TObjString * ReadBuffer(const char *, Long64_t, Int_t)
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
virtual ~TProofLogElem()
Destructor.
Int_t Grep(const char *txt, Int_t from=0)
Search lines containing 'txt', starting from line 'from'.
TString & Remove(Ssiz_t pos)
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
virtual Bool_t IsValid() const
friend class TProofLogElem
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
void Print(Option_t *opt=0) const
Print head info about the content.
TProofLogElem * Add(const char *ord, const char *url)
Add new entry to the list of elements.
virtual void Add(TObject *obj)
TProofLogElem(const char *ord, const char *url, TProofLog *logger)
Constructor.
Int_t Atoi() const
Return integer value of string.
Int_t Save(const char *ord="*", const char *fname=0, Option_t *opt="w")
Save the content associated with worker 'ord' to finel 'fname'.
Int_t Retrieve(TProofLog::ERetrieveOpt opt=TProofLog::kTrailing, const char *pattern=0)
Retrieve the content of the associated file.
Bool_t IsDigit() const
Returns true if all characters in string are digits (0-9) or white spaces, i.e.
virtual Int_t GetSize() const
static Long64_t GetMaxTransferSize()
Get max transfer size.
virtual TObjString * AddLine(const char *text)
Add line with text in the list of lines of this macro.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Implementation of the PROOF session log handler.
virtual const char * GetTitle() const
Returns title of object.
const char * Data() const
Int_t Retrieve(const char *ord="*", TProofLog::ERetrieveOpt opt=TProofLog::kTrailing, const char *fname=0, const char *pattern=0)
Retrieve the content of the log file associated with worker 'ord'.