News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

CodeTune Timming Analyzer - V 1.0 (Update 09/01/16)

Started by guga, December 30, 2015, 08:33:13 AM

Previous topic - Next topic

dedndave

the CR (control registers) are defined in the Intel manuals
most of us rarely use them, so that part of the manual is easily skipped   :biggrin:

guga

Found some good info from intel and other sites

http://www.cise.ufl.edu/~sb3/files/pmc.pdf
http://www.rcollins.org/p6/opcodes/RDPMC.html
https://en.wikipedia.org/wiki/Control_register
http://search.luky.org/linux-kernel.2000/msg25962.html

You may want to read it for your functions that reads CPU contents :)
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

guga

Can someone, please test to see if i ported Agner´s Fog driver correctly ?

Here the driver on I7, seems to work and the app is reading the rdpmc instruction. I´ll see the app itself (the executable) and try to implement it on the library as well, if it is really working as expected :)
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

Grincheux

Windows cannot launch it

Quotethe application failed to start because its side by side configuration ...

guga

Tks :)

Did you used the "teste.bat" ? 

Perhaps it is not launching because the app was for Intel and not AMD or you don´t have RDPMC instruction, i guess. The driver works here on intel.

From Agner´s fog manual it tells to open the counter rdpmc using the command startcounters and close it with stopcounters. So, on the batch file you must use "guga.exe startcounters" to open and "guga.exe stopcounters"

But....Agner fog said that after you are enabling the counter you must close it immediatelly (you can´t let it open as far i read). So, you can write 2 more batch files for the necessary command . Example

File1 - Create a batch file to start the counter with this. Name it as "Start.bat"
guga.exe startcounters
pause


File2 -  - Create a batch file to close the counter with this. Name it as "Stop.bat"
guga.exe stopcounters
pause


FIle3 - The batch file provided in the zip to run after you started the counter (without any command). Name it as "Go.bat"
guga.exe
pause


So, if you are using the bacth file, you can do this (in order):
a) Click on Start.bat to activate (enable) the counters
b) Click in Go.bat to use and measure the timmings
c) Click in Stop.bat to stop (disable) the counters

Btw: guga.exe is the Agner´s fog pcmtestB.exe from where i renamed and compiled with VS. What i ported to Asm was the driver (and not the main AF executable)



But....i´m testing it here too and as far i can tell, the results of this rdpmc did not impressed me at all. In fact, the timmings are similar to rdtsc+lfence and way way worst then  the timmings measured with the new CreateTimeProfileEx api

I´m currently reading his manual and trying to port what i can to analyze if it will be worthfull use it on the library. The timmings really didn´t impressed me, but i´ll make a tests on the latency, throughputs etc as described in his files.

If i could be able to understand how he managed to compute those things, i can try to do the same without the neeeds of using the driver (neither the rdpmc instruction)

Just for you have an idea of how it is being measured

Enabling rdpmc here in my I7 and Using it with CreateTimeProfile api it resulted in 5,43 nanoseconds on Jochen function (similar result to rdtsc).

When i tested it under the new Api on my library (CreateTimeProfileEx), i still got better time wirh rdtscp (3,78 nanoseconds).

The only good thing i´m seeing about this is that the result using the driver seems more stable (but not accurated at all). I´m trying to see how all of this work exactly to see if it wil be really usefull somehow.
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

guga

About that particular error...I guess i found why


"This issue is caused by a conflict with some of the files in the 2008 version of the C run-time libraries. These libraries are part of the Visual Studio 2008 release, the version numbers start with 9.0. These libraries may be installed with several different Microsoft and third party products."

https://support.microsoft.com/en-us/kb/2525435

This is one of the reasons why i truly hate VS  :icon_mrgreen:
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

Grincheux


qWord

guga,

might it be possible to upload your documentation on some place that does not requires a registration nor 1000s wait-time?

regards
MREAL macros - when you need floating point arithmetic while assembling!

fearless

I created a chm help file from the original pdf (and the updated pdf one for the newest CreateProfileTimeEx functions and structures).

Put it together couple weeks ago, and have been meaning to upload it, but got sidetracked with other stuff. Its so that guga can package it with his library - if he so wishes to do so - or leave it as an additional extra someone can download if they want to, or ignore it all together - all valid and totally cool.

I have the source project as well, for guga to use as he wishes, to add/modify etc etc. I havnt included the appendix I and II in the chm file - hadnt got round to adding them in.
All credits are to guga, i just put the chm together.

The project was created using RoboHelp HTML X5.0.1, the source is linked here, on dropbox: https://www.dropbox.com/s/9o0ke0lc8aj70tj/CodeTune%20Library%20CHM%20Source.zip?dl=0

This is the dropbox link for the chm file itself, probably most people will opt to download this: https://www.dropbox.com/s/2eh9n3n65woywrn/CodeTune%20Library.chm?dl=0

Hopefully someone will find it useful.

guga

Hi qword. 1000 secs ? Damn...4shared is making people wait that long when they are not registered ?

Try this one  :t

http://docdro.id/onPXIMc

Let me know if this site still makes people wait too much.

Fearless....Huge Thanks !!!!  :t :t :t :t

I´m a bit busy updating a couple of things in RosAsm before the next release. I plan to also include a update of CodeTune as well, but i needed to fix some issues in RosAsm that was there since ages :icon_mrgreen:
And, trying to make an update on the interface as well. (I´m tired the old visual style of the toolbar)

This is a hell of a work, because the major functions in RosAsm are way too attached to the interface so it is hard to isolate them without breaking other parts of the code. This is needed, since i plan to eventually make some functions ready to import and export lib and obj files too. (Not only see it´s contents as it actually is on the LibScanner)

I succeeded to isolate some major functions related to memory management and built it as the dll (RosMem.dll), but on the way i messed up with some parts of RosAsm that used it and i´m tracing where the errors occurs so i can fix. The good thing is that i suceeded to fix some allocationg problems of huge files that was stopping the debugger to load files such as Sony vegas (or the dlls it used, specially dlls that are packed). Now i can load and create a Sony Vegas plugin and debug the whole program without problems (finally  :biggrin:).
Also i improved the disassembler in terms of accuracy and speed, but still needs some adjusts in the inner core of the decoder before i try to implement new SSE3/SSE4 instructions). Since those "new" opcodes are not that relevant at the moment (This stage of development, i mean), i choosed to improve it before add newer opcodes.
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

qWord

Quote from: guga on January 24, 2016, 02:31:28 PM
Let me know if this site still makes people wait too much.
much better - no wait time nor any other restriction.

The mathematic excursus makes your documentation somehow pleasant, BTW  :P
MREAL macros - when you need floating point arithmetic while assembling!

guga

QuoteThe mathematic excursus makes your documentation somehow pleasant, BTW  :P
:icon_mrgreen: Many tks

I like those explanations as simple as possible. Much easier to understand on that way rather then simply putting all formulas on an article.

I did engineering when i was young (but, never graduated. Left it and migrated onto law school  :greensml:) but it is hard for me to remember all those math symbols and formulas so, i choose to read some that are more pleasant to read and easier to follow.

Whenever i have to understand some of those sigma, mu, theta and complicated math formulas (Integrals, derivated etc) to try to use on some algos (for video/image enhancement, specially), my mind twist 3 times, do some spins around, burn and finally blow of the top of my head :icon_mrgreen: :icon_mrgreen: :icon_mrgreen:
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com