| 407 | { |
| 408 | public: |
| 409 | explicit LinuxProcessInfo(int pid, int sessionPid) |
| 410 | : UnixProcessInfo(pid) |
| 411 | { |
| 412 | if (pid == 0 || _cGroupCreationFailed) { |
| 413 | return; |
| 414 | } |
| 415 | |
| 416 | if (_createdAppCGroupPath.isEmpty() && !_cGroupCreationFailed) { |
| 417 | _cGroupCreationFailed = !initCGroupHierachy(pid); |
| 418 | if (KonsoleSettings::enableMemoryMonitoring() && !_cGroupCreationFailed) { |
| 419 | setUnitMemLimit(KonsoleSettings::memoryLimitValue()); |
| 420 | } |
| 421 | return; |
| 422 | } |
| 423 | |
| 424 | const bool isForegroundProcess = sessionPid != -1; |
| 425 | |
| 426 | if (!isForegroundProcess) { |
| 427 | _cGroupCreationFailed = !createCGroup(QStringLiteral("tab(%1).scope").arg(pid), pid); |
| 428 | } else { |
| 429 | _cGroupCreationFailed = !moveToCGroup(getProcCGroup(sessionPid), pid); |
| 430 | } |
| 431 | } |
| 432 | |
| 433 | static bool setUnitMemLimit(const int newMemHigh) |
| 434 | { |