feg208 wrote:
@clayborg This pr is ready for re-review
https://github.com/llvm/llvm-project/pull/91544
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
feg208 wrote:
@clayborg This pr is ready for re-review
https://github.com/llvm/llvm-project/pull/91544
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
feg208 wrote:
@clayborg I rolled up those requested changes. That'll make a nicer interface
https://github.com/llvm/llvm-project/pull/91544
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
@@ -195,48 +195,66 @@ class ProcessInstanceInfo : public ProcessInfo {
return m_process_session_id != LLDB_INVALID_PROCESS_ID;
}
- struct timespec GetUserTime() const { return m_user_time; }
+ struct timespec GetUserTime() const { return m_user_time.value(); }
@@ -195,48 +195,66 @@ class ProcessInstanceInfo : public ProcessInfo {
return m_process_session_id != LLDB_INVALID_PROCESS_ID;
}
- struct timespec GetUserTime() const { return m_user_time; }
+ struct timespec GetUserTime() const { return m_user_time.value(); }
@@ -195,48 +195,66 @@ class ProcessInstanceInfo : public ProcessInfo {
return m_process_session_id != LLDB_INVALID_PROCESS_ID;
}
- struct timespec GetUserTime() const { return m_user_time; }
+ struct timespec GetUserTime() const { return m_user_time.value(); }
@@ -250,10 +268,12 @@ class ProcessInstanceInfo : public ProcessInfo {
lldb::pid_t m_parent_pid = LLDB_INVALID_PROCESS_ID;
lldb::pid_t m_process_group_id = LLDB_INVALID_PROCESS_ID;
lldb::pid_t m_process_session_id = LLDB_INVALID_PROCESS_ID;
- struct timespec m_user_time
@@ -250,10 +268,12 @@ class ProcessInstanceInfo : public ProcessInfo {
lldb::pid_t m_parent_pid = LLDB_INVALID_PROCESS_ID;
lldb::pid_t m_process_group_id = LLDB_INVALID_PROCESS_ID;
lldb::pid_t m_process_session_id = LLDB_INVALID_PROCESS_ID;
- struct timespec m_user_time
https://github.com/feg208 edited https://github.com/llvm/llvm-project/pull/91544
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
@@ -147,96 +148,111 @@ class ProcessInstanceInfo : public ProcessInfo {
ProcessInstanceInfo() = default;
ProcessInstanceInfo(const char *name, const ArchSpec , lldb::pid_t pid)
- : ProcessInfo(name, arch, pid), m_euid(UINT32_MAX), m_egid(UINT32_MAX),
-
https://github.com/feg208 updated
https://github.com/llvm/llvm-project/pull/91544
>From 8f694b7ab4436c0540284cbbf280ad557a750920 Mon Sep 17 00:00:00 2001
From: Fred Grim
Date: Wed, 8 May 2024 15:36:16 -0700
Subject: [PATCH] [lldb] Adds additional fields to ProcessInfo
To implement SaveCore
feg208 wrote:
> A message like this that the PR is ready for re-review should be all you
> need. Several folks left comments and they might be waiting for all of them
> to be addressed before they take another look.
Ok. @clayborg I think I have addressed your concerns but I'd love another
https://github.com/feg208 updated
https://github.com/llvm/llvm-project/pull/91544
>From e7b1cf56dae4c93b871aeeeafc5b40752baf823e Mon Sep 17 00:00:00 2001
From: Fred Grim
Date: Wed, 8 May 2024 15:36:16 -0700
Subject: [PATCH] [lldb] Adds additional fields to ProcessInfo
To implement SaveCore
feg208 wrote:
Hello all. I am wondering what I can do to advance this patch? I think it is
required to support process save-core in linux for lldb. I'd love to move this
before adding static methods in ThreadEfCore.h to produce populated prpsinfo
and prstatus structs for inclusion in a
https://github.com/feg208 updated
https://github.com/llvm/llvm-project/pull/91544
>From 8b9ffe9bfb20c5c911c1c08ef966b4ac1ac587a0 Mon Sep 17 00:00:00 2001
From: Fred Grim
Date: Wed, 8 May 2024 15:36:16 -0700
Subject: [PATCH] [lldb] Adds additional fields to ProcessInfo
To implement SaveCore
@@ -147,96 +148,111 @@ class ProcessInstanceInfo : public ProcessInfo {
ProcessInstanceInfo() = default;
ProcessInstanceInfo(const char *name, const ArchSpec , lldb::pid_t pid)
- : ProcessInfo(name, arch, pid), m_euid(UINT32_MAX), m_egid(UINT32_MAX),
-
https://github.com/feg208 updated
https://github.com/llvm/llvm-project/pull/91544
>From b35ded1c20bb67df941bb7c54aece789a18cde99 Mon Sep 17 00:00:00 2001
From: Fred Grim
Date: Wed, 8 May 2024 15:36:16 -0700
Subject: [PATCH] [lldb] Adds additional fields to ProcessInfo
To implement SaveCore
https://github.com/feg208 updated
https://github.com/llvm/llvm-project/pull/91544
>From dbb4b4126754be15ffd9d12d9997e4969f7ba5cf Mon Sep 17 00:00:00 2001
From: Fred Grim
Date: Wed, 8 May 2024 15:36:16 -0700
Subject: [PATCH] [lldb] Adds additional fields to ProcessInfo
To implement SaveCore
@@ -147,96 +148,111 @@ class ProcessInstanceInfo : public ProcessInfo {
ProcessInstanceInfo() = default;
ProcessInstanceInfo(const char *name, const ArchSpec , lldb::pid_t pid)
- : ProcessInfo(name, arch, pid), m_euid(UINT32_MAX), m_egid(UINT32_MAX),
-
@@ -147,96 +148,111 @@ class ProcessInstanceInfo : public ProcessInfo {
ProcessInstanceInfo() = default;
ProcessInstanceInfo(const char *name, const ArchSpec , lldb::pid_t pid)
- : ProcessInfo(name, arch, pid), m_euid(UINT32_MAX), m_egid(UINT32_MAX),
-
feg208 wrote:
> Sorry for the nits! I am not smart enough to contribute on the technical
> merits, so I am trying to find some way to help!
Ehhh grammar is not where I shine. I rolled them up
https://github.com/llvm/llvm-project/pull/91544
___
@@ -70,6 +71,12 @@ struct StatFields {
long unsigned stime;
long cutime;
long cstime;
+ // in proc_pid_stat(5) this field is specified as priority
feg208 wrote:
done
https://github.com/llvm/llvm-project/pull/91544
@@ -70,6 +71,12 @@ struct StatFields {
long unsigned stime;
long cutime;
long cstime;
+ // in proc_pid_stat(5) this field is specified as priority
+ // but documented as realtime priority. To keep with the adopted
+ // nomenclature in ProcessInstanceInfo we adopt the
@@ -70,6 +71,12 @@ struct StatFields {
long unsigned stime;
long cutime;
long cstime;
+ // in proc_pid_stat(5) this field is specified as priority
+ // but documented as realtime priority. To keep with the adopted
+ // nomenclature in ProcessInstanceInfo we adopt the
@@ -115,13 +124,19 @@ static bool GetStatusInfo(::pid_t Pid,
ProcessInstanceInfo ,
return ts;
};
+ // priority (nice) values run from 19 to -20 inclusive (in linux). In the
feg208 wrote:
done
https://github.com/llvm/llvm-project/pull/91544
@@ -115,13 +124,19 @@ static bool GetStatusInfo(::pid_t Pid,
ProcessInstanceInfo ,
return ts;
};
+ // priority (nice) values run from 19 to -20 inclusive (in linux). In the
+ // prpsinfo struct pr_nice is a char
feg208 wrote:
done
@@ -86,4 +89,22 @@ TEST_F(HostTest, GetProcessInfo) {
ProcessInstanceInfo::timespec next_user_time = Info.GetUserTime();
ASSERT_TRUE(user_time.tv_sec <= next_user_time.tv_sec ||
user_time.tv_usec <= next_user_time.tv_usec);
+
+ struct rlimit rlim;
+
https://github.com/feg208 updated
https://github.com/llvm/llvm-project/pull/91544
>From d01efd10f8a4b7d908acaa3237541bf6a83b4c7c Mon Sep 17 00:00:00 2001
From: Fred Grim
Date: Wed, 8 May 2024 15:36:16 -0700
Subject: [PATCH] [lldb] Adds additional fields to ProcessInfo
To implement SaveCore
@@ -144,6 +144,19 @@ class ProcessInstanceInfo : public ProcessInfo {
long int tv_usec = 0;
};
+ enum class ProcessState {
+Unknown,
+Dead,
+DiskSleep,
+Idle,
+Paging,
+Parked,
+Running,
+Sleeping,
+TracedOrStopped,
+Zombie,
+
@@ -91,14 +87,16 @@ static bool GetStatusInfo(::pid_t Pid, ProcessInstanceInfo
,
if (Rest.empty())
return false;
StatFields stat_fields;
- if (sscanf(Rest.data(),
- "%d %s %c %d %d %d %d %d %u %lu %lu %lu %lu %lu %lu %ld %ld",
- _fields.pid,
https://github.com/feg208 updated
https://github.com/llvm/llvm-project/pull/91544
>From dbf56b2ebe93d2f3ef6e41bceb7359f6e10ae38d Mon Sep 17 00:00:00 2001
From: Fred Grim
Date: Wed, 8 May 2024 15:36:16 -0700
Subject: [PATCH] [lldb] Adds additional fields to ProcessInfo
To implement SaveCore
@@ -254,6 +280,8 @@ class ProcessInstanceInfo : public ProcessInfo {
struct timespec m_system_time {};
struct timespec m_cumulative_user_time {};
struct timespec m_cumulative_system_time {};
+ std::optional m_priority_value = std::nullopt;
+ bool m_zombie = false;
@@ -237,6 +250,16 @@ class ProcessInstanceInfo : public ProcessInfo {
m_cumulative_system_time.tv_usec > 0;
}
+ int8_t GetNiceValue() const { return m_nice_value; }
feg208 wrote:
prpsinfo has pr_nice field to be populated
@@ -237,6 +250,16 @@ class ProcessInstanceInfo : public ProcessInfo {
m_cumulative_system_time.tv_usec > 0;
}
+ int8_t GetNiceValue() const { return m_nice_value; }
feg208 wrote:
Done. Agreed. I also added a note in the linux specific code. In
@@ -237,6 +250,16 @@ class ProcessInstanceInfo : public ProcessInfo {
m_cumulative_system_time.tv_usec > 0;
}
+ int8_t GetNiceValue() const { return m_nice_value; }
+
+ void SetNiceValue(int8_t nice_value) { m_nice_value = nice_value; }
+
+ bool
@@ -17,6 +17,7 @@
#include
#include
+#include
feg208 wrote:
removed
https://github.com/llvm/llvm-project/pull/91544
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
@@ -117,6 +118,10 @@ bool ProcessInfo::IsScriptedProcess() const {
return m_scripted_metadata_sp && *m_scripted_metadata_sp;
}
+bool ProcessInstanceInfo::NiceValueIsValid() const {
+ return m_nice_value >= PRIO_MIN && m_nice_value <= PRIO_MAX;
feg208
https://github.com/feg208 updated
https://github.com/llvm/llvm-project/pull/91544
>From 18b0d55d1c4e04842e531c7f7e304998f2b2ad4e Mon Sep 17 00:00:00 2001
From: Fred Grim
Date: Wed, 8 May 2024 15:36:16 -0700
Subject: [PATCH] [lldb] Adds additional fields to ProcessInfo
To implement SaveCore
@@ -12,6 +12,9 @@
#include "lldb/Utility/ProcessInfo.h"
#include "gtest/gtest.h"
+#include
+#include
feg208 wrote:
yeah. The cmake file enforces a linux-only build as well. However as @jimingham
pointed out someone could plausibly move this into a
@@ -254,6 +277,8 @@ class ProcessInstanceInfo : public ProcessInfo {
struct timespec m_system_time {};
struct timespec m_cumulative_user_time {};
struct timespec m_cumulative_system_time {};
+ int8_t m_nice_value = INT8_MAX;
feg208 wrote:
yeah. I'll
@@ -144,6 +144,19 @@ class ProcessInstanceInfo : public ProcessInfo {
long int tv_usec = 0;
};
+ enum class ProcessState {
+Unknown,
+Dead,
+DiskSleep,
+Idle,
+Paging,
+Parked,
+Running,
+Sleeping,
+TracedOrStopped,
+Zombie,
+
https://github.com/feg208 updated
https://github.com/llvm/llvm-project/pull/91544
>From 57e47b53682d43d2b1febba721688c6931c43291 Mon Sep 17 00:00:00 2001
From: Fred Grim
Date: Wed, 8 May 2024 15:36:16 -0700
Subject: [PATCH] [lldb] Adds additional fields to ProcessInfo
To implement SaveCore
https://github.com/feg208 created
https://github.com/llvm/llvm-project/pull/91544
To implement SaveCore for elf binaries we need to populate some additional
fields in the prpsinfo struct. Those fields are the nice value of the process
whose core is to be taken as well as a boolean flag
https://github.com/feg208 closed https://github.com/llvm/llvm-project/pull/89637
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
https://github.com/feg208 updated
https://github.com/llvm/llvm-project/pull/89637
>From 41175787b1f5d1451d5ea88618ca6c229a415c0f Mon Sep 17 00:00:00 2001
From: Fred Grim
Date: Mon, 22 Apr 2024 10:17:14 -0700
Subject: [PATCH] [lldb] Reenable test HostTest.GetProcessInfo with relaxed
https://github.com/feg208 updated
https://github.com/llvm/llvm-project/pull/89637
>From edc21c6ec34486b6155ef0ec6f6be97a9bd0f0bb Mon Sep 17 00:00:00 2001
From: Fred Grim
Date: Mon, 22 Apr 2024 10:17:14 -0700
Subject: [PATCH] [lldb] Reenable test HostTest.GetProcessInfo with relaxed
https://github.com/feg208 edited https://github.com/llvm/llvm-project/pull/89637
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
https://github.com/feg208 edited https://github.com/llvm/llvm-project/pull/89637
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
https://github.com/feg208 updated
https://github.com/llvm/llvm-project/pull/89637
>From bd0416d37d61e71f36e9afc435f9209b544bdb78 Mon Sep 17 00:00:00 2001
From: Fred Grim
Date: Mon, 22 Apr 2024 10:17:14 -0700
Subject: [PATCH] [lldb] Reenable test HostTest.GetProcessInfo with relaxed
feg208 wrote:
> Hi @feg208 , I noticed that your [previous commit
> ](https://github.com/llvm/llvm-project/pull/89267) has a very.. unusual
> commit title and message. The same thing applies to this PR.
>
> I'd appreciate it if you could follow a more standard commit title and
> message, so
https://github.com/feg208 updated
https://github.com/llvm/llvm-project/pull/89637
>From 9ef4220b01a9cb18c3f23b78ae7aa3b80c2a7851 Mon Sep 17 00:00:00 2001
From: Fred Grim
Date: Mon, 22 Apr 2024 10:17:14 -0700
Subject: [PATCH] I left some commented code in. This test doesn't run reliably
in the
feg208 wrote:
> A potential compromise would be to check that the time is great or equal?
That's a good idea. I'll make that change and add a note
https://github.com/llvm/llvm-project/pull/89637
___
lldb-commits mailing list
https://github.com/feg208 created
https://github.com/llvm/llvm-project/pull/89637
@jimingham I am wondering if you are ok removing this test? It caused failures
in some of the build bots because the user time was less than a microsecond.
Alternatively we can increase the number of loops or
https://github.com/feg208 closed https://github.com/llvm/llvm-project/pull/89267
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
feg208 wrote:
I had to just comment this test out because it randomly fails on at least
x86_64 and arm
https://github.com/llvm/llvm-project/pull/89267
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://github.com/feg208 updated
https://github.com/llvm/llvm-project/pull/89267
>From 24fa0fc2f54ef4141302ed7178ee0dc1b6d6af4e Mon Sep 17 00:00:00 2001
From: Fred Grim
Date: Thu, 18 Apr 2024 10:13:03 -0700
Subject: [PATCH] this test is flakey on arm in linux because I got too clever
---
https://github.com/feg208 created
https://github.com/llvm/llvm-project/pull/89267
the assembly jazz doesn't work on arm. oops
>From 13e982588d75b240ce515c8ff1b2d9c89a595908 Mon Sep 17 00:00:00 2001
From: Fred Grim
Date: Thu, 18 Apr 2024 10:13:03 -0700
Subject: [PATCH] this test is flakey on
https://github.com/feg208 closed https://github.com/llvm/llvm-project/pull/88995
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
feg208 wrote:
> Yes, you'd have to put this test into a host test for a system that doesn't
> support this, like use the Posix one or make one for the Windows or Darwin
> Hosts.
Done!
https://github.com/llvm/llvm-project/pull/88995
___
lldb-commits
https://github.com/feg208 updated
https://github.com/llvm/llvm-project/pull/88995
>From 9b8ec4d0c31ad1b228add56bc27cd79457e515c7 Mon Sep 17 00:00:00 2001
From: Fred Grim
Date: Tue, 16 Apr 2024 14:46:37 -0700
Subject: [PATCH 1/3] adds additional information to the ProcessInfo object for
elf
feg208 wrote:
> It should never decrease, however. If you were just getting garbage values,
> then there should be a roughly even chance the second value will be less than
> the first. So this still gives some confidence this isn't totally bogus...
For sure. My concern is that it wouldn't
feg208 wrote:
> That test looks good. It seems unlikely that you would buggily always produce
> monotonically increasing times...
>
> Not to be a pest, but since this info is only provided on Linux, we should
> maybe add a test to make sure that asking for this information on systems
> that
feg208 wrote:
> That test looks good. It seems unlikely that you would buggily always produce
> monotonically increasing times...
>
> Not to be a pest, but since this info is only provided on Linux, we should
> maybe add a test to make sure that asking for this information on systems
> that
https://github.com/feg208 updated
https://github.com/llvm/llvm-project/pull/88995
>From 9b8ec4d0c31ad1b228add56bc27cd79457e515c7 Mon Sep 17 00:00:00 2001
From: Fred Grim
Date: Tue, 16 Apr 2024 14:46:37 -0700
Subject: [PATCH 1/2] adds additional information to the ProcessInfo object for
elf
feg208 wrote:
> The user and system times should be monotonically increasing. So you could
> stop at a breakpoint, fetch the times, then run your program through a little
> spin loop to burn some CPU before hitting a second breakpoint. Then get the
> times again and assert that they are > the
https://github.com/feg208 updated
https://github.com/llvm/llvm-project/pull/88995
>From 9b8ec4d0c31ad1b228add56bc27cd79457e515c7 Mon Sep 17 00:00:00 2001
From: Fred Grim
Date: Tue, 16 Apr 2024 14:46:37 -0700
Subject: [PATCH 1/2] adds additional information to the ProcessInfo object for
elf
feg208 wrote:
> The user and system times should be monotonically increasing. So you could
> stop at a breakpoint, fetch the times, then run your program through a little
> spin loop to burn some CPU before hitting a second breakpoint. Then get the
> times again and assert that they are > the
feg208 wrote:
> These seem like fairly POSIX-y bits of data, is there not a Posix way to get
> these (so other posix systems will also get this info?)
Not that I know of for arbitrary processes in linux. fwiw the original code
without these values got similar bits out of the proc filesystem
https://github.com/feg208 created
https://github.com/llvm/llvm-project/pull/88995
This adds some additional bits into a ProcessInfo structure that will be of use
in filling structs in an elf core file. This is a demand for implementing
process save-core
>From
69 matches
Mail list logo