garrysmod-issues
garrysmod-issues copied to clipboard
[Linux DS 64] VProf doesn't work.
Details
On 64x Linux DS, vprof doesn't seem to work.
As far as I found out, it is caused by CVProfile::InTargetThread
failing.
It fails because it compares CVProfile::m_TargetThreadId
(an unsigned int
) against ThreadGetCurrentId
(an ThreadId_t
/ uint64
) which then fails to compare.
CVProfile::m_TargetThreadId
should probably be changed to ThreadId_t
/ an uint64 to match ThreadGetCurrentId
.
An example to easily see the Issue I mean:
#include <cstdio>
#include <pthread.h>
int main()
{
unsigned m_TargetThreadId = pthread_self(); // Basicly what vprof does
unsigned long int pthread_Id = pthread_self(); // You can see the type difference
printf("%u %lu %s!\n", m_TargetThreadId, pthread_Id, m_TargetThreadId == pthread_Id ? "true" : "false");
return 0;
}
Steps to reproduce
- Run
vprof_on
- Run
vprof_generate_report
- See the empty report
NOTE: This could maybe be linked to https://github.com/Facepunch/garrysmod-issues/issues/5981