/[pkgs]/devel/CodeAnalyst-gui/ca-use-dynamic-feature-check.patch
ViewVC logotype

Contents of /devel/CodeAnalyst-gui/ca-use-dynamic-feature-check.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download) (as text)
Thu Nov 5 18:47:23 2009 UTC (2 weeks, 5 days ago) by suravee
Branch: MAIN
CVS Tags: CodeAnalyst-gui-2_8_54-20_fc13, HEAD
File MIME type: text/x-patch
-Add ca-fix-su.patch
-Add ca-use-dynamic-feature-check.patch
-Remove codeanalyst service
-Bump release number
1 diff -paurN CodeAnalyst-gui-2.8.54/src/ca/gui/application.cpp CodeAnalyst-gui-2.8.54-user-dynamic-feature-check/src/ca/gui/application.cpp
2 --- CodeAnalyst-gui-2.8.54/src/ca/gui/application.cpp 2009-06-18 06:54:47.000000000 -0500
3 +++ CodeAnalyst-gui-2.8.54-user-dynamic-feature-check/src/ca/gui/application.cpp 2009-07-29 10:27:48.000000000 -0500
4 @@ -863,7 +863,7 @@ void ApplicationWindow::onSamplingStart
5 return;
6 }
7
8 - if (!m_opIf.checkIbsSupportInDaemon())
9 + if (m_opIf.checkIbsSupportInDaemon() < 0 )
10 {
11 QMessageBox::critical (this, "CodeAnalyst Error",
12 QString("Current OProfile daemon does not supported IBS profile\n")
13 @@ -1482,14 +1482,15 @@ void ApplicationWindow:: enumerateAllIbs
14 if (pIbsSession->opSample && (*ev_it).op_name.contains("IBS_OP_")) {
15 bypass = false;
16 QString t = QString::number(pIbsSession->opInterval, 10);
17 -#if (OPD_NO_DISPATCH_OP_OPTION == 1)
18 - op_name = QString("event:") + (*ev_it).op_name +
19 - " count:" + t + " unit-mask:0";
20 -#else
21 - op_name = QString("event:") + (*ev_it).op_name +
22 - " count:" + t + " unit-mask:"
23 - + ((pIbsSession->opCycleCount)? "0" : "1") ;
24 -#endif
25 +
26 + if (m_opIf.checkDispatchOpInDaemon() > 0) {
27 + op_name = QString("event:") + (*ev_it).op_name +
28 + " count:" + t + " unit-mask:"
29 + + ((pIbsSession->opCycleCount)? "0" : "1") ;
30 + } else {
31 + op_name = QString("event:") + (*ev_it).op_name +
32 + " count:" + t + " unit-mask:0";
33 + }
34 }
35
36 if (bypass)
37 @@ -1506,13 +1507,12 @@ void ApplicationWindow:: enumerateAllIbs
38 if (pIbsSession->fetchSample
39 && (*ev_it).op_name.contains("IBS_FETCH_"))
40 {
41 -#if (OP_VERSION_BASE >= 0x00905)
42 - // If specify list and not found
43 - if (pIbsSession->fetchList.size() != 0
44 - && pIbsSession->fetchList.find((*ev_it).value) == pIbsSession->fetchList.end())
45 - continue;
46 -#endif
47 -
48 + if (m_opIf.checkIbsSupportInDaemon() >= 2) {
49 + // If specify list and not found
50 + if (pIbsSession->fetchList.size() != 0
51 + && pIbsSession->fetchList.find((*ev_it).value) == pIbsSession->fetchList.end())
52 + continue;
53 + }
54
55 eet.eventCount = pIbsSession->fetchInterval;
56 eet.eventMask = (*ev_it).value;
57 @@ -1524,13 +1524,12 @@ void ApplicationWindow:: enumerateAllIbs
58 if (pIbsSession->opSample
59 && (*ev_it).op_name.contains("IBS_OP_"))
60 {
61 -#if (OP_VERSION_BASE >= 0x00905)
62 - // If specify list and not found
63 - if (pIbsSession->opList.size() != 0
64 - && pIbsSession->opList.find((*ev_it).value) == pIbsSession->opList.end())
65 - continue;
66 -#endif
67 -
68 + if (m_opIf.checkIbsSupportInDaemon() >= 2) {
69 + // If specify list and not found
70 + if (pIbsSession->opList.size() != 0
71 + && pIbsSession->opList.find((*ev_it).value) == pIbsSession->opList.end())
72 + continue;
73 + }
74
75 eet.eventCount = pIbsSession->opInterval;
76 eet.eventMask = EncodeEventMask((*ev_it).value,
77 @@ -2911,64 +2910,64 @@ bool ApplicationWindow::runIbs ()
78 ibs_prop.dispatched_ops = 1;
79 }
80
81 -#if (OP_VERSION_BASE >= 0x00905)
82 - // NOTE: If the fetchList or opList is empty while it is being enabled,
83 - // we would add all fetch/op events to the list.
84 - // This would help keep the old IBS DCCOnfig compatible.
85 - bool fixFetchList = false;
86 - bool fixOpList = false;
87 -
88 - if (pIbsSession->fetchSample && pIbsSession->fetchList.size() == 0 )
89 - fixFetchList = true;
90 -
91 - if (pIbsSession->opSample && pIbsSession->opList.size() == 0 )
92 - fixOpList = true;
93 -
94 - if (fixFetchList || fixOpList) {
95 - EventList evList;
96 - m_eventFile.findIbsEvent(evList);
97 -
98 - EventList::iterator ev_it = evList.begin();
99 - EventList::iterator ev_end = evList.end();
100 - for(;ev_it != ev_end; ev_it++) {
101 - if (0xF000 <= (*ev_it).value && (*ev_it).value < 0xF100 && fixFetchList) {
102 - //fetch
103 - pIbsSession->fetchList.append((*ev_it).value);
104 - } else if (0xF100 <= (*ev_it).value && fixOpList) {
105 - //op
106 - pIbsSession->opList.append((*ev_it).value);
107 + if (m_opIf.checkIbsSupportInDaemon() >= 2) {
108 + // NOTE: If the fetchList or opList is empty while it is being enabled,
109 + // we would add all fetch/op events to the list.
110 + // This would help keep the old IBS DCCOnfig compatible.
111 + bool fixFetchList = false;
112 + bool fixOpList = false;
113 +
114 + if (pIbsSession->fetchSample && pIbsSession->fetchList.size() == 0 )
115 + fixFetchList = true;
116 +
117 + if (pIbsSession->opSample && pIbsSession->opList.size() == 0 )
118 + fixOpList = true;
119 +
120 + if (fixFetchList || fixOpList) {
121 + EventList evList;
122 + m_eventFile.findIbsEvent(evList);
123 +
124 + EventList::iterator ev_it = evList.begin();
125 + EventList::iterator ev_end = evList.end();
126 + for(;ev_it != ev_end; ev_it++) {
127 + if (0xF000 <= (*ev_it).value && (*ev_it).value < 0xF100 && fixFetchList) {
128 + //fetch
129 + pIbsSession->fetchList.append((*ev_it).value);
130 + } else if (0xF100 <= (*ev_it).value && fixOpList) {
131 + //op
132 + pIbsSession->opList.append((*ev_it).value);
133 + }
134 }
135 - }
136 - }
137 + }
138 +
139 + // Convert list of IBS Fetch event number to op-name for oprofiled
140 + QValueList<unsigned int>::iterator it = pIbsSession->fetchList.begin();
141 + QValueList<unsigned int>::iterator it_end = pIbsSession->fetchList.end();
142 + for (; it != it_end; it++)
143 + {
144 + CpuEvent event;
145 + m_eventFile.findEventByValue(*it, event);
146
147 - // Convert list of IBS Fetch event number to op-name for oprofiled
148 - QValueList<unsigned int>::iterator it = pIbsSession->fetchList.begin();
149 - QValueList<unsigned int>::iterator it_end = pIbsSession->fetchList.end();
150 - for (; it != it_end; it++)
151 - {
152 - CpuEvent event;
153 - m_eventFile.findEventByValue(*it, event);
154 -
155 - if (0xF000 <= *it && *it < 0xF100) {
156 - //fetch
157 - ibs_prop.fetch_strList.append(event.op_name);
158 + if (0xF000 <= *it && *it < 0xF100) {
159 + //fetch
160 + ibs_prop.fetch_strList.append(event.op_name);
161 + }
162 }
163 - }
164 -
165 - // Convert list of IBS Op event number to op-name for oprofiled
166 - it = pIbsSession->opList.begin();
167 - it_end = pIbsSession->opList.end();
168 - for (; it != it_end; it++)
169 - {
170 - CpuEvent event;
171 - m_eventFile.findEventByValue(*it, event);
172 +
173 + // Convert list of IBS Op event number to op-name for oprofiled
174 + it = pIbsSession->opList.begin();
175 + it_end = pIbsSession->opList.end();
176 + for (; it != it_end; it++)
177 + {
178 + CpuEvent event;
179 + m_eventFile.findEventByValue(*it, event);
180
181 - if (0xF100 <= *it) {
182 - //op
183 - ibs_prop.op_strList.append(event.op_name);
184 + if (0xF100 <= *it) {
185 + //op
186 + ibs_prop.op_strList.append(event.op_name);
187 + }
188 }
189 }
190 -#endif
191
192 ibs_prop.dcMissInfoEnabled = pIbsSession->dcMissInfoEnabled;
193
194 diff -paurN CodeAnalyst-gui-2.8.54/src/ca/gui/CfgIbs.cpp CodeAnalyst-gui-2.8.54-user-dynamic-feature-check/src/ca/gui/CfgIbs.cpp
195 --- CodeAnalyst-gui-2.8.54/src/ca/gui/CfgIbs.cpp 2009-06-23 16:41:21.000000000 -0500
196 +++ CodeAnalyst-gui-2.8.54-user-dynamic-feature-check/src/ca/gui/CfgIbs.cpp 2009-07-29 10:27:48.000000000 -0500
197 @@ -21,6 +21,7 @@
198 #include "CfgIbs.h"
199 #include "iruncontrol.h"
200 #include "atuneoptions.h"
201 +#include "oprofile_interface.h"
202 #include <qbuttongroup.h>
203 #include "xp.h"
204
205 @@ -213,11 +214,11 @@ void IbsCfgDlg::setProfile (ProfileColle
206 m_pOpInterval->setText (QString::number (ibsOptions.opInterval));
207 m_pOp->setChecked (ibsOptions.opSample);
208
209 -#if (OPD_NO_DCMISSINFO_OPTION == 0)
210 - m_pDcMissInfoEnabled->setChecked (ibsOptions.dcMissInfoEnabled);
211 -#else
212 - m_pDcMissInfoEnabled->hide();
213 -#endif
214 + oprofile_interface opIf;
215 + if (opIf.checkDCMissInfoInDaemon() > 0)
216 + m_pDcMissInfoEnabled->setChecked (ibsOptions.dcMissInfoEnabled);
217 + else
218 + m_pDcMissInfoEnabled->hide();
219
220 // Check REV C support
221 char VendorId[15];
222 @@ -242,24 +243,24 @@ void IbsCfgDlg::setProfile (ProfileColle
223 m_pOpDispatch->setChecked (false);
224 }
225
226 -#if (OP_VERSION_BASE >= 0x00905)
227 - // Load events to IBS Fetch List
228 - QString file = helpGetEventFile(Family, Model);
229 - if( !m_eventsFile.open (file) )
230 - {
231 - QMessageBox::information( this, "Error",
232 - "Unable to open the events file: " + file);
233 - }
234 - addIbsEventFromFileToList(Model);
235 + if (opIf.checkIbsSupportInDaemon() >= 2) {
236 + // Load events to IBS Fetch List
237 + QString file = helpGetEventFile(Family, Model);
238 + if( !m_eventsFile.open (file) )
239 + {
240 + QMessageBox::information( this, "Error",
241 + "Unable to open the events file: " + file);
242 + }
243 + addIbsEventFromFileToList(Model);
244
245 - selectIbsEvents(&ibsOptions);
246 -#else
247 - m_pFetchList->hide();
248 - m_pSelectAllFetch->hide();
249 - m_pOpList->hide();
250 - m_pSelectAllOp->hide();
251 - this->resize(0,0);
252 -#endif
253 + selectIbsEvents(&ibsOptions);
254 + } else {
255 + m_pFetchList->hide();
256 + m_pSelectAllFetch->hide();
257 + m_pOpList->hide();
258 + m_pSelectAllOp->hide();
259 + this->resize(0,0);
260 + }
261
262 m_pLaunchBox->hide();
263 m_modified = false;
264 diff -paurN CodeAnalyst-gui-2.8.54/src/ca/gui/oprofile_interface.cpp CodeAnalyst-gui-2.8.54-user-dynamic-feature-check/src/ca/gui/oprofile_interface.cpp
265 --- CodeAnalyst-gui-2.8.54/src/ca/gui/oprofile_interface.cpp 2009-07-29 10:28:41.000000000 -0500
266 +++ CodeAnalyst-gui-2.8.54-user-dynamic-feature-check/src/ca/gui/oprofile_interface.cpp 2009-07-29 10:27:48.000000000 -0500
267 @@ -71,6 +71,9 @@ oprofile_interface::oprofile_interface (
268 m_isDaemonStarted = false;
269 m_daemon_pid = 0;
270 m_numEventCountersAvailable = 0;
271 + m_ibsVersion = 0;
272 + m_hasDispatchOpInDaemon = 0;
273 + m_hasDCMissInfoInDaemon = 0;
274
275 CA_OPROFILE_CONTROLLER = simplifyPath(CA_OPROFILE_CONTROLLER);
276 }
277 @@ -290,63 +293,62 @@ int oprofile_interface::help_start_daemo
278 opd_args.append (event_args);
279 }
280
281 - //********************************************************
282 -#if (OP_VERSION_BASE >= 0x00905)
283 - // IBS2 stuff
284 - // --ext-feature=ibs:fetch:ev1,ev2,...,evN:fetch_count:fetch_um|op:ev1,ev2,...,evN:op_count:op_um
285 -
286 - buf = "";
287 - if( (active_profiling & OP_IBS_FETCH)
288 - || (active_profiling & OP_IBS_OP))
289 - opd_args.append("--ext-feature=ibs:");
290 -
291 - if (active_profiling & OP_IBS_FETCH) {
292 - buf = QString("fetch:") +
293 - m_pIbsProperties->fetch_strList.join(",") + ":" +
294 - QString::number(m_pIbsProperties->fetch_count) + ":" +
295 - QString::number(m_pIbsProperties->fetch_um);
296 - }
297 -
298 - if (active_profiling & OP_IBS_OP) {
299 - if (active_profiling & OP_IBS_FETCH)
300 - buf = buf + QString("\\|");
301 -
302 - buf = buf + QString("op:") +
303 - m_pIbsProperties->op_strList.join(",") + ":" +
304 - QString::number(m_pIbsProperties->op_count) + ":" +
305 - QString::number(m_pIbsProperties->op_um);
306 - }
307 - opd_args.append (buf);
308 + if (checkIbsSupportInDaemon() == 2) {
309 + //********************************************************
310 + // IBS2 stuff
311 + // --ext-feature=ibs:fetch:ev1,ev2,...,evN:fetch_count:fetch_um|op:ev1,ev2,...,evN:op_count:op_um
312 +
313 + buf = "";
314 + if( (active_profiling & OP_IBS_FETCH)
315 + || (active_profiling & OP_IBS_OP))
316 + opd_args.append("--ext-feature=ibs:");
317
318 -#else //(OP_VERSION_BASE >= 0x00905)
319 + if (active_profiling & OP_IBS_FETCH) {
320 + buf = QString("fetch:") +
321 + m_pIbsProperties->fetch_strList.join(",") + ":" +
322 + QString::number(m_pIbsProperties->fetch_count) + ":" +
323 + QString::number(m_pIbsProperties->fetch_um);
324 + }
325
326 - // IBS1 stuff
327 - buf = "";
328 - if( (active_profiling & OP_IBS_FETCH)
329 - || (active_profiling & OP_IBS_OP))
330 - opd_args.append("--events= ");
331 + if (active_profiling & OP_IBS_OP) {
332 + if (active_profiling & OP_IBS_FETCH)
333 + buf = buf + QString("\\|");
334
335 - if (active_profiling & OP_IBS_FETCH) {
336 - buf.sprintf("--ibs-fetch=%ld ", m_pIbsProperties->fetch_count);
337 + buf = buf + QString("op:") +
338 + m_pIbsProperties->op_strList.join(",") + ":" +
339 + QString::number(m_pIbsProperties->op_count) + ":" +
340 + QString::number(m_pIbsProperties->op_um);
341 + }
342 opd_args.append (buf);
343 - }
344 + }
345 + else if (checkIbsSupportInDaemon() == 1) {
346 + // IBS1 stuff
347 + buf = "";
348 + if( (active_profiling & OP_IBS_FETCH)
349 + || (active_profiling & OP_IBS_OP))
350 + opd_args.append("--events= ");
351
352 - if (active_profiling & OP_IBS_OP) {
353 - buf.sprintf("--ibs-op=%ld ", m_pIbsProperties->op_count);
354 - opd_args.append (buf);
355 + if (active_profiling & OP_IBS_FETCH) {
356 + buf.sprintf("--ibs-fetch=%ld ", m_pIbsProperties->fetch_count);
357 + opd_args.append (buf);
358 + }
359
360 -#if (OPD_NO_DISPATCH_OP_OPTION == 0)
361 - if(m_pIbsProperties->dispatched_ops)
362 - opd_args.append ("--ibs-op-dispatch-op ");
363 -#endif
364 -
365 -#if (OPD_NO_DCMISSINFO_OPTION == 0)
366 - if(m_pIbsProperties->dcMissInfoEnabled)
367 - opd_args.append ("--ibs-op-dcmissinfo-enable ");
368 -#endif
369 + if (active_profiling & OP_IBS_OP) {
370 + buf.sprintf("--ibs-op=%ld ", m_pIbsProperties->op_count);
371 + opd_args.append (buf);
372 +
373 + if (checkDispatchOpInDaemon() > 0) {
374 + if(m_pIbsProperties->dispatched_ops)
375 + opd_args.append ("--ibs-op-dispatch-op ");
376 + }
377 +
378 + if (checkDCMissInfoInDaemon() > 0) {
379 + if(m_pIbsProperties->dcMissInfoEnabled)
380 + opd_args.append ("--ibs-op-dcmissinfo-enable ");
381 + }
382
383 + }
384 }
385 -#endif //(OP_VERSION_BASE >= 0x00905)
386
387 // END CMD LINE APPENDING.
388
389 @@ -1137,29 +1139,84 @@ bool oprofile_interface::havePermissionT
390 }
391
392
393 -bool oprofile_interface::checkIbsSupportInDaemon()
394 +int oprofile_interface::checkIbsSupportInDaemon()
395 {
396 - bool ret = false;
397 QString command;
398 +
399 + if (m_ibsVersion != 0)
400 + goto out;
401
402 -#if (OP_VERSION_BASE == 0x00903)
403 + // CA-OProfile-0.9.3
404 command = QString(OP_BINDIR) +
405 "/opcontrol --help 2>&1 " +
406 "| grep ibs-fetch 2> /dev/null > /dev/null";
407
408 - ret = (system(command.ascii()) == 0)? true: false;
409 -#endif
410 + if (system(command.ascii()) == 0) {
411 + m_ibsVersion = 1;
412 + goto out;
413 + }
414
415 -#if (OP_VERSION_BASE >= 0x00905)
416 -
417 + // OProfile-0.9.5
418 command = QString(OP_BINDIR) +
419 "/oprofiled --help 2>&1 " +
420 "| grep ext-feature 2> /dev/null > /dev/null";
421 - ret = (system(command.ascii()) == 0)? true: false;
422 -#endif
423 - return ret;
424 + if (system(command.ascii()) == 0) {
425 + m_ibsVersion = 2;
426 + goto out;
427 + }
428 +
429 + m_ibsVersion = -1;
430 +out:
431 + return m_ibsVersion;
432 }
433
434 +
435 +int oprofile_interface::checkDispatchOpInDaemon()
436 +{
437 + bool ret = false;
438 + QString command;
439 +
440 + if (m_hasDispatchOpInDaemon != 0)
441 + goto out;
442 +
443 + // CA-OProfile-0.9.3
444 + command = QString(OP_BINDIR) +
445 + "/opcontrol --help 2>&1 " +
446 + "| grep ibs-op-dispatch-op 2> /dev/null > /dev/null";
447 +
448 + ret = (system(command.ascii()) == 0)? true: false;
449 + if (ret)
450 + m_hasDispatchOpInDaemon = 1;
451 + else
452 + m_hasDispatchOpInDaemon = -1;
453 +out:
454 + return m_hasDispatchOpInDaemon;
455 +}
456 +
457 +
458 +int oprofile_interface::checkDCMissInfoInDaemon()
459 +{
460 + bool ret = false;
461 + QString command;
462 +
463 + if (m_hasDCMissInfoInDaemon != 0)
464 + goto out;
465 +
466 + // CA-OProfile-0.9.3
467 + command = QString(OP_BINDIR) +
468 + "/opcontrol --help 2>&1 " +
469 + "| grep ibs-op-dcmissinfo-enable 2> /dev/null > /dev/null";
470 +
471 + ret = (system(command.ascii()) == 0)? true: false;
472 + if (ret)
473 + m_hasDCMissInfoInDaemon = 1;
474 + else
475 + m_hasDCMissInfoInDaemon = -1;
476 +out:
477 + return m_hasDCMissInfoInDaemon;
478 +}
479 +
480 +
481 bool oprofile_interface::checkMuxSupportInDaemon()
482 {
483 // NOTE: This check allows only the CodeAnalyst Oprofile
484 diff -paurN CodeAnalyst-gui-2.8.54/src/ca/gui/oprofile_interface.h CodeAnalyst-gui-2.8.54-user-dynamic-feature-check/src/ca/gui/oprofile_interface.h
485 --- CodeAnalyst-gui-2.8.54/src/ca/gui/oprofile_interface.h 2009-06-10 15:45:23.000000000 -0500
486 +++ CodeAnalyst-gui-2.8.54-user-dynamic-feature-check/src/ca/gui/oprofile_interface.h 2009-07-29 10:27:48.000000000 -0500
487 @@ -94,7 +94,11 @@ public:
488
489 bool codeanalyst_service_status();
490
491 - bool checkIbsSupportInDaemon();
492 + int checkIbsSupportInDaemon();
493 +
494 + int checkDispatchOpInDaemon();
495 +
496 + int checkDCMissInfoInDaemon();
497
498 bool checkMuxSupportInDaemon();
499
500 @@ -134,19 +138,18 @@ private:
501 QString simplifyPath(QString path);
502
503 private:
504 - op_ibs_property * m_pIbsProperties;
505 -
506 - op_event_property m_EventProperties[MAX_EVENTNUM_MULTIPLEXING];
507 -
508 - QProcess * m_proc;
509 -
510 - QString m_StdErr;
511 - QString m_StdOut;
512 + QProcess * m_proc;
513 + op_ibs_property * m_pIbsProperties;
514 + op_event_property m_EventProperties[MAX_EVENTNUM_MULTIPLEXING];
515 + QString m_StdErr;
516 + QString m_StdOut;
517 + int m_numEventCountersAvailable;
518 + bool m_isDaemonStarted;
519 + unsigned int m_daemon_pid;
520 + int m_ibsVersion;
521 + int m_hasDispatchOpInDaemon;
522 + int m_hasDCMissInfoInDaemon;
523
524 - int m_numEventCountersAvailable;
525 -
526 - bool m_isDaemonStarted;
527 - unsigned int m_daemon_pid;
528 };
529
530 #endif

admin@fedoraproject.org
ViewVC Help
Powered by ViewVC 1.1.2