diff --git a/buildproto.bat b/buildproto.bat index db46758..116a7a3 100644 --- a/buildproto.bat +++ b/buildproto.bat @@ -1 +1 @@ -clang++ -DDEBUG src\proto\proto.cpp -o build\ayo.exe -Wall -Wextra -Wpedantic -std=c++11 -g -gcodeview -Wl,-pdb= -L C:\capybara\libclang\x86_64-w64-mingw32\bin -l c++ -l unwind -static --verbose +clang++ -DDEBUG src\proto\proto.cpp -o build\ayo.exe -Wall -Wextra -Wpedantic -std=c++11 -g -gcodeview -Wl,-pdb= -L C:\capybara\libclang\x86_64-w64-mingw32\bin -static-libstdc++ -static --verbose diff --git a/src/proto/proto.cpp b/src/proto/proto.cpp index c5b2e7a..53ba00f 100644 --- a/src/proto/proto.cpp +++ b/src/proto/proto.cpp @@ -1,7 +1,3 @@ -<<<<<<< Updated upstream -======= -//si, bueno, testx ->>>>>>> Stashed changes /* * THREADIN THE LINUS: https://linux.die.net/man/2/sched_setaffinity */ @@ -29,7 +25,7 @@ Intel(R) 64 and IA-32 Architectures Software Developer's Manual Volume 3 (3A, 3B //TSC is incremented by the base multiplier once every reference clock, so on my Xeon E5-2680 (Sandy Bridge EP) this is an increment of 27 every 10 ns - +//https://github.com/jdmccalpin/low-overhead-timers/issues/1 #ifdef _WIN64 //#include @@ -45,7 +41,7 @@ Intel(R) 64 and IA-32 Architectures Software Developer's Manual Volume 3 (3A, 3B #include #include #endif -#ifdef NOMESELDELINUS +#ifdef LOwOnus //hilitos y tal #endif @@ -53,6 +49,17 @@ Intel(R) 64 and IA-32 Architectures Software Developer's Manual Volume 3 (3A, 3B #include #include "../debug.h" +uint64_t checksatr(){ //Generic + uint64_t rcx; + asm volatile (".intel_syntax noprefix\t\n" \ + "mov eax, 0x80000007\t\n" \ + // 080000007h\t\n" + "cpuid\t\n" : "=c" (rcx) ); + //bool iTSC = rcx & (1<<6); + //"and edx, 10000000\n") + return rcx; +} + bool checkInvariantTSC(){ //Generic uint64_t rdx; asm volatile (".intel_syntax noprefix\t\n" \ @@ -96,10 +103,11 @@ EDX Bits 31-00: Reserved = 0. */ -char* AMDMeCagoEnTusPutosMuertos () { +char* AMDTest() { /* * Extended name on AMD systems when using 8000_002-4. 8000_0000 for Extpagequant/vendor. Hijos de puta. * Now parsing 0H for standard brand name + * https://github.com/jdmccalpin/low-overhead-timers/issues/1 */ char* palabritas = (char*)malloc(sizeof(char) * 13); uint8_t siguienteLetra = 0; @@ -119,8 +127,8 @@ char* AMDMeCagoEnTusPutosMuertos () { return palabritas; } -//GMET on??????????? jfc wtf -bool AMDJoderMET(){ +//GMET on??????????? Zenbros... +bool AMDGMET(){ uint64_t rdx; asm volatile ( ".intel_syntax noprefix\t\n" \ "mov eax, 0x8000000A\t\n" \ @@ -248,7 +256,7 @@ uint64_t estimandoFreq(){ valLen = MAX_VALUE_NAME; //data NULL + len NON_NULL to get dataBufLen; //data allocated (NON-NULL) + len NON-NULL with previous value for dataLen - //JFC MS WHY. that why we defaultin to biggis. cos not worky. ewe + //MS WHY. that why we defaultin to biggis. cos not worky. ewe dataLen = sizeof(REG_QWORD) * (longestDataSize); status = RegEnumValueW(key, i, @@ -278,9 +286,7 @@ uint64_t estimandoFreq(){ ) ) { //dataLen = dataLen * 2lu; - /* BROS YO ES QUE ME VOY A CAGAR EN SUS PUTOS MUERTOS - * ASí QUE PIDES DOS VECES, UNA TAMAńO, OTRA A TOPE PRESISO, EH - * PUTA BASURA DE API + /* We do be usin' well designed APIs...... * status = RegEnumValueW(key, * i, * valName, @@ -312,14 +318,15 @@ uint64_t estimandoFreq(){ int main(int argc, char** argv){ //AMD Momento - char* opiniones = AMDMeCagoEnTusPutosMuertos(); - bool w11 = AMDJoderMET(); + char* opiniones = AMDTest(); + bool w11 = AMDGMET(); for (int i = 0; i < 3; i++) { uint64_t isItActually32GHz = estimandoFreq(); log_debugcpp("ayo we found " << isItActually32GHz << " flash knuckle"); } int64_t juas = getFreqFromReg(); - log_debugcpp("JODER " << juas); + log_debugcpp("satr " << checksatr()); + log_debugcpp("Invariant " << checkInvariantTSC()); //iwintewel //Cordura diff --git a/src/test/test.cpp b/src/test/test.cpp index 35b9e1d..8126175 100644 --- a/src/test/test.cpp +++ b/src/test/test.cpp @@ -53,7 +53,7 @@ int main(int argc, char** argv){ if(timer == nullptr) return -2; uint64_t wfr = getQPCFrequency(); - int64_t fr = timer->getBaseFrequency(); + int64_t fr = 3193999000;//timer->getBaseFrequency(); uint64_t wt1 = getQPCTicks(); @@ -66,9 +66,9 @@ int main(int argc, char** argv){ //uint64_t fr = timer->getBaseFrequency(); uint64_t wt2 = getQPCTicks(); std::cout << "Sleep: " << sleep << "s\n-----------------\nTest 1: TSCTimer within QPC\n" << std::endl; - std::cout << " QPC Momento: \nt1: " << wt1 << " t2: " << wt2 << " fr: " << wfr << std::endl; + std::cout << "QPC Momento: \n t1: " << wt1 << " t2: " << wt2 << " fr: " << wfr << std::endl; std::cout << " restita: " << wt2-wt1 << std::endl; - std::cout << " TSCTimer Momento: \nt1: " << t1 << " t2: " << t2 << " fr: " << fr << std::endl; + std::cout << "TSCTimer Momento: \n t1: " << t1 << " t2: " << t2 << " fr: " << fr << std::endl; std::cout << " restita: " << t2-t1 << std::endl; std::cout << " checks: " << checks << "\n-----------------\nTest 2: QPC within TSCTimer\n"<< std::endl; @@ -83,7 +83,7 @@ int main(int argc, char** argv){ //uint64_t fr = timer->getBaseFrequency(); t2 = timer->getTimeStamp(); std::cout << "QPC Momento: \n t1: " << wt1 << " t2: " << wt2 << " fr: " << wfr << std::endl; - std::cout << "restita: " << wt2-wt1 << std::endl; + std::cout << " restita: " << wt2-wt1 << std::endl; std::cout << "TSCTimer Momento: \n t1: " << t1 << " t2: " << t2 << " fr: " << fr << std::endl; std::cout << " restita: " << t2-t1 << std::endl; std::cout << " checks: " << checks << std::endl;