about mysqlslap can not connect the mysql on osv

2018-04-23 Thread wang Yu
1、scripts/build image=mysql
2、scripts/run.py -nv to start mysql server on osv
OSv v0.24-511-ge60339d eth0: 192.168.122.76 
3、on host i use mysqlslap to test the benchmark
mysqlslap -h 192.168.122.76 -P 3306 --concurrency=100--iterations=1
--create-schema='mysql' --query='select * from user;'
--number-of-queries=10 -u admin -p
mysqlslap: Error when connecting to server: Host '192.168.122.1' is
not allowed to connect to this MySQL server

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH v2 1/2] Fix no output boot_time event "TLS initialization"

2018-04-12 Thread Wang Yu
Before patch boot with --bootchart, "TLS initialization"
is not output
...
disk read (real mode): 50.71ms, (+50.71ms)
.init functions: 89.20ms, (+5.48ms)
SMP launched: 90.56ms, (+1.36ms)
VFS initialized: 95.76ms, (+5.20ms)
...
after patch,
...
disk read (real mode): 50.71ms, (+50.71ms)
TLS initialization: 83.72ms, (+33.01ms)
.init functions: 89.20ms, (+5.48ms)
SMP launched: 90.56ms, (+1.36ms)
VFS initialized: 95.76ms, (+5.20ms)
...
Signed-off-by: Wang Yu 
Signed-off-by: Waldek Kozaczuk 
---
 arch/x64/arch-setup.cc |  4 ++--
 core/chart.cc  | 14 --
 include/osv/boot.hh|  7 ---
 loader.cc  |  2 +-
 4 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/arch/x64/arch-setup.cc b/arch/x64/arch-setup.cc
index 325c26a..e4c1ab0 100644
--- a/arch/x64/arch-setup.cc
+++ b/arch/x64/arch-setup.cc
@@ -134,11 +134,11 @@ void arch_setup_free_memory()
 u64 time;
 time = omb.tsc_init_hi;
 time = (time << 32) | omb.tsc_init;
-boot_time.arrays[0] = { "", time };
+boot_time.event(0, "", time );
 
 time = omb.tsc_disk_done_hi;
 time = (time << 32) | omb.tsc_disk_done;
-boot_time.arrays[1] = { "disk read (real mode)", time };
+boot_time.event(1, "disk read (real mode)", time );
 
 auto c = processor::cpuid(0x8000);
 if (c.a >= 0x8008) {
diff --git a/core/chart.cc b/core/chart.cc
index 86153a2..59311a9 100644
--- a/core/chart.cc
+++ b/core/chart.cc
@@ -20,8 +20,18 @@ void boot_time_chart::print_one_time(int index)
 
 void boot_time_chart::event(const char *str)
 {
-arrays[_event].str  = str;
-arrays[_event++].stamp = processor::ticks();
+event(_event++, str, processor::ticks());
+}
+
+void boot_time_chart::event(int event_idx, const char *str)
+{
+event(event_idx, str, processor::ticks());
+}
+
+void boot_time_chart::event(int event_idx, const char *str, u64 stamp)
+{
+arrays[event_idx].str = str;
+arrays[event_idx].stamp = stamp;
 }
 
 void boot_time_chart::print_chart()
diff --git a/include/osv/boot.hh b/include/osv/boot.hh
index eb97cc9..391ad8f 100644
--- a/include/osv/boot.hh
+++ b/include/osv/boot.hh
@@ -12,16 +12,17 @@ public:
 class boot_time_chart {
 public:
 void event(const char *str);
+void event(int event_idx, const char *str);
+void event(int event_idx, const char *str, u64 stamp);
 void print_chart();
-time_element arrays[16];
-friend void arch_setup_free_memory();
 private:
 // Can we keep it at 0 and let the initial two users increment it?  No, we
 // cannot. The reason is that the code that *parses* those fields run
 // relatively late (the code that takes the measure is so early it cannot
 // call this one directly. Therefore, the measurements would appear in the
 // middle of the list, and we want to preserve order.
-int _event = 2;
+int _event = 3;
+time_element arrays[16];
 
 void print_one_time(int index);
 double to_msec(u64 time);
diff --git a/loader.cc b/loader.cc
index f6cbd4d..a2da220 100644
--- a/loader.cc
+++ b/loader.cc
@@ -109,7 +109,7 @@ void premain()
 }
 
 setup_tls(inittab);
-boot_time.event("TLS initialization");
+boot_time.event(2,"TLS initialization");
 for (auto init = inittab.start; init < inittab.start + inittab.count; 
++init) {
 (*init)();
 }
-- 
1.8.3.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH v2 2/2] add boot_time event of uncompress lzloader.elf

2018-04-12 Thread Wang Yu
sometimes i found uncompres cost serival times,
so add boot_time event of uncompress lzloader.elf
after patch
...
disk read (real mode): 45.09ms, (+45.09ms)
uncompress lzloader.elf: 76.90ms, (+31.81ms)
TLS initialization: 77.65ms, (+0.75ms)
.init functions: 82.69ms, (+5.04ms)
SMP launched: 83.72ms, (+1.03ms)
VFS initialized: 88.67ms, (+4.95ms)
...

Signed-off-by: Wang Yu 
---
 arch/x64/arch-setup.cc | 5 +
 arch/x64/boot16.S  | 7 ++-
 include/osv/boot.hh| 2 +-
 loader.cc  | 2 +-
 4 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/arch/x64/arch-setup.cc b/arch/x64/arch-setup.cc
index e4c1ab0..6e4833c 100644
--- a/arch/x64/arch-setup.cc
+++ b/arch/x64/arch-setup.cc
@@ -50,6 +50,7 @@ struct osv_multiboot_info_type {
 struct multiboot_info_type mb;
 u32 tsc_init, tsc_init_hi;
 u32 tsc_disk_done, tsc_disk_done_hi;
+u32 tsc_uncompress_done, tsc_uncompress_done_hi;
 u8 disk_err;
 } __attribute__((packed));
 
@@ -140,6 +141,10 @@ void arch_setup_free_memory()
 time = (time << 32) | omb.tsc_disk_done;
 boot_time.event(1, "disk read (real mode)", time );
 
+time = omb.tsc_uncompress_done_hi;
+time = (time << 32) | omb.tsc_uncompress_done;
+boot_time.event(2, "uncompress lzloader.elf", time );
+
 auto c = processor::cpuid(0x8000);
 if (c.a >= 0x8008) {
 c = processor::cpuid(0x8008);
diff --git a/arch/x64/boot16.S b/arch/x64/boot16.S
index d8808bd..d053a3f 100644
--- a/arch/x64/boot16.S
+++ b/arch/x64/boot16.S
@@ -20,7 +20,9 @@ mb_tsc1_lo = (mb_info + 88)
 mb_tsc1_hi = (mb_info + 88 + 4)
 mb_tsc_disk_lo = (mb_info + 88 + 8)
 mb_tsc_disk_hi = (mb_info + 88 + 12)
-mb_disk_err = (mb_info + 88 + 16)
+mb_uncompress_lo = (mb_info + 88 + 16)
+mb_uncompress_hi = (mb_info + 88 + 20)
+mb_disk_err = (mb_info + 88 + 24)
 mb_cmdline = (mb_info + 16)
 mb_mmap_len = (mb_info + 44)
 mb_mmap_addr = (mb_info + 48)
@@ -161,6 +163,9 @@ done_e820:
 mov %eax, %fs
 mov %eax, %ss
 call *lzentry
+rdtsc
+mov %eax, mb_uncompress_lo
+mov %edx, mb_uncompress_hi
 mov $loader, %eax
 mov $mb_info, %ebx
 call *entry
diff --git a/include/osv/boot.hh b/include/osv/boot.hh
index 391ad8f..b8fb194 100644
--- a/include/osv/boot.hh
+++ b/include/osv/boot.hh
@@ -21,7 +21,7 @@ private:
 // relatively late (the code that takes the measure is so early it cannot
 // call this one directly. Therefore, the measurements would appear in the
 // middle of the list, and we want to preserve order.
-int _event = 3;
+int _event = 4;
 time_element arrays[16];
 
 void print_one_time(int index);
diff --git a/loader.cc b/loader.cc
index a2da220..3f88ebd 100644
--- a/loader.cc
+++ b/loader.cc
@@ -109,7 +109,7 @@ void premain()
 }
 
 setup_tls(inittab);
-boot_time.event(2,"TLS initialization");
+boot_time.event(3,"TLS initialization");
 for (auto init = inittab.start; init < inittab.start + inittab.count; 
++init) {
 (*init)();
 }
-- 
1.8.3.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH v2 2/2] add boot_time event of uncompress lzloader.elf

2018-04-11 Thread Wang Yu
sometimes i found uncompres cost serival times,
so add boot_time event of uncompress lzloader.elf
after patch
...
disk read (real mode): 45.09ms, (+45.09ms)
uncompress lzloader.elf: 76.90ms, (+31.81ms)
TLS initialization: 77.65ms, (+0.75ms)
.init functions: 82.69ms, (+5.04ms)
SMP launched: 83.72ms, (+1.03ms)
VFS initialized: 88.67ms, (+4.95ms)
...

Signed-off-by: Wang Yu 
---
 arch/x64/arch-setup.cc | 5 +
 arch/x64/boot16.S  | 7 ++-
 include/osv/boot.hh| 2 +-
 loader.cc  | 2 +-
 4 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/arch/x64/arch-setup.cc b/arch/x64/arch-setup.cc
index e4c1ab0..6e4833c 100644
--- a/arch/x64/arch-setup.cc
+++ b/arch/x64/arch-setup.cc
@@ -50,6 +50,7 @@ struct osv_multiboot_info_type {
 struct multiboot_info_type mb;
 u32 tsc_init, tsc_init_hi;
 u32 tsc_disk_done, tsc_disk_done_hi;
+u32 tsc_uncompress_done, tsc_uncompress_done_hi;
 u8 disk_err;
 } __attribute__((packed));
 
@@ -140,6 +141,10 @@ void arch_setup_free_memory()
 time = (time << 32) | omb.tsc_disk_done;
 boot_time.event(1, "disk read (real mode)", time );
 
+time = omb.tsc_uncompress_done_hi;
+time = (time << 32) | omb.tsc_uncompress_done;
+boot_time.event(2, "uncompress lzloader.elf", time );
+
 auto c = processor::cpuid(0x8000);
 if (c.a >= 0x8008) {
 c = processor::cpuid(0x8008);
diff --git a/arch/x64/boot16.S b/arch/x64/boot16.S
index d8808bd..d053a3f 100644
--- a/arch/x64/boot16.S
+++ b/arch/x64/boot16.S
@@ -20,7 +20,9 @@ mb_tsc1_lo = (mb_info + 88)
 mb_tsc1_hi = (mb_info + 88 + 4)
 mb_tsc_disk_lo = (mb_info + 88 + 8)
 mb_tsc_disk_hi = (mb_info + 88 + 12)
-mb_disk_err = (mb_info + 88 + 16)
+mb_uncompress_lo = (mb_info + 88 + 16)
+mb_uncompress_hi = (mb_info + 88 + 20)
+mb_disk_err = (mb_info + 88 + 24)
 mb_cmdline = (mb_info + 16)
 mb_mmap_len = (mb_info + 44)
 mb_mmap_addr = (mb_info + 48)
@@ -161,6 +163,9 @@ done_e820:
 mov %eax, %fs
 mov %eax, %ss
 call *lzentry
+rdtsc
+mov %eax, mb_uncompress_lo
+mov %edx, mb_uncompress_hi
 mov $loader, %eax
 mov $mb_info, %ebx
 call *entry
diff --git a/include/osv/boot.hh b/include/osv/boot.hh
index 391ad8f..b8fb194 100644
--- a/include/osv/boot.hh
+++ b/include/osv/boot.hh
@@ -21,7 +21,7 @@ private:
 // relatively late (the code that takes the measure is so early it cannot
 // call this one directly. Therefore, the measurements would appear in the
 // middle of the list, and we want to preserve order.
-int _event = 3;
+int _event = 4;
 time_element arrays[16];
 
 void print_one_time(int index);
diff --git a/loader.cc b/loader.cc
index a2da220..3f88ebd 100644
--- a/loader.cc
+++ b/loader.cc
@@ -109,7 +109,7 @@ void premain()
 }
 
 setup_tls(inittab);
-boot_time.event(2,"TLS initialization");
+boot_time.event(3,"TLS initialization");
 for (auto init = inittab.start; init < inittab.start + inittab.count; 
++init) {
 (*init)();
 }
-- 
1.8.3.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH v2 1/2] Fix no output boot_time event "TLS initialization"

2018-04-11 Thread Wang Yu
Before patch boot with --bootchart, "TLS initialization"
is not output
...
disk read (real mode): 50.71ms, (+50.71ms)
.init functions: 89.20ms, (+5.48ms)
SMP launched: 90.56ms, (+1.36ms)
VFS initialized: 95.76ms, (+5.20ms)
...
after patch,
...
disk read (real mode): 50.71ms, (+50.71ms)
TLS initialization: 83.72ms, (+33.01ms)
.init functions: 89.20ms, (+5.48ms)
SMP launched: 90.56ms, (+1.36ms)
VFS initialized: 95.76ms, (+5.20ms)
...
Signed-off-by: Wang Yu 
Signed-off-by: Waldek Kozaczuk 
---
 arch/x64/arch-setup.cc |  4 ++--
 core/chart.cc  | 14 --
 include/osv/boot.hh|  7 ---
 loader.cc  |  2 +-
 4 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/arch/x64/arch-setup.cc b/arch/x64/arch-setup.cc
index 325c26a..e4c1ab0 100644
--- a/arch/x64/arch-setup.cc
+++ b/arch/x64/arch-setup.cc
@@ -134,11 +134,11 @@ void arch_setup_free_memory()
 u64 time;
 time = omb.tsc_init_hi;
 time = (time << 32) | omb.tsc_init;
-boot_time.arrays[0] = { "", time };
+boot_time.event(0, "", time );
 
 time = omb.tsc_disk_done_hi;
 time = (time << 32) | omb.tsc_disk_done;
-boot_time.arrays[1] = { "disk read (real mode)", time };
+boot_time.event(1, "disk read (real mode)", time );
 
 auto c = processor::cpuid(0x8000);
 if (c.a >= 0x8008) {
diff --git a/core/chart.cc b/core/chart.cc
index 86153a2..59311a9 100644
--- a/core/chart.cc
+++ b/core/chart.cc
@@ -20,8 +20,18 @@ void boot_time_chart::print_one_time(int index)
 
 void boot_time_chart::event(const char *str)
 {
-arrays[_event].str  = str;
-arrays[_event++].stamp = processor::ticks();
+event(_event++, str, processor::ticks());
+}
+
+void boot_time_chart::event(int event_idx, const char *str)
+{
+event(event_idx, str, processor::ticks());
+}
+
+void boot_time_chart::event(int event_idx, const char *str, u64 stamp)
+{
+arrays[event_idx].str = str;
+arrays[event_idx].stamp = stamp;
 }
 
 void boot_time_chart::print_chart()
diff --git a/include/osv/boot.hh b/include/osv/boot.hh
index eb97cc9..391ad8f 100644
--- a/include/osv/boot.hh
+++ b/include/osv/boot.hh
@@ -12,16 +12,17 @@ public:
 class boot_time_chart {
 public:
 void event(const char *str);
+void event(int event_idx, const char *str);
+void event(int event_idx, const char *str, u64 stamp);
 void print_chart();
-time_element arrays[16];
-friend void arch_setup_free_memory();
 private:
 // Can we keep it at 0 and let the initial two users increment it?  No, we
 // cannot. The reason is that the code that *parses* those fields run
 // relatively late (the code that takes the measure is so early it cannot
 // call this one directly. Therefore, the measurements would appear in the
 // middle of the list, and we want to preserve order.
-int _event = 2;
+int _event = 3;
+time_element arrays[16];
 
 void print_one_time(int index);
 double to_msec(u64 time);
diff --git a/loader.cc b/loader.cc
index f6cbd4d..a2da220 100644
--- a/loader.cc
+++ b/loader.cc
@@ -109,7 +109,7 @@ void premain()
 }
 
 setup_tls(inittab);
-boot_time.event("TLS initialization");
+boot_time.event(2,"TLS initialization");
 for (auto init = inittab.start; init < inittab.start + inittab.count; 
++init) {
 (*init)();
 }
-- 
1.8.3.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [PATCH] fix no output boot_time event "TLS initialization"

2018-04-11 Thread Wang Yu



在 18/4/12 上午10:50, Waldek Kozaczuk 写道:

Including the author of the patch.

Sent from my iPhone

On Apr 10, 2018, at 23:44, Waldek Kozaczuk <mailto:jwkozac...@gmail.com>> wrote:



Nice catch.

Even though the patch addresses the bug it also makes _event member 
variable public and therefore weakens encapsulation. I wonder if we 
can address this bug along these lines:

i agree it, thanks for your review,
then i commit v2 patch, and add reviewer Waldek Kozaczuk 


ok?


diff --git a/arch/x64/arch-setup.cc <http://arch-setup.cc> 
b/arch/x64/arch-setup.cc <http://arch-setup.cc>

index 325c26a..e4c1ab0 100644
--- a/arch/x64/arch-setup.cc <http://arch-setup.cc>
+++ b/arch/x64/arch-setup.cc <http://arch-setup.cc>
@@ -134,11 +134,11 @@ void arch_setup_free_memory()
 u64 time;
 time = omb.tsc_init_hi;
 time = (time << 32) | omb.tsc_init;
-boot_time.arrays[0] = { "", time };
+boot_time.event(0, "", time );
 time = omb.tsc_disk_done_hi;
 time = (time << 32) | omb.tsc_disk_done;
-boot_time.arrays[1] = { "disk read (real mode)", time };
+boot_time.event(1, "disk read (real mode)", time );
 auto c = processor::cpuid(0x8000);
 if (c.a >= 0x8008) {
diff --git a/core/chart.cc <http://chart.cc> b/core/chart.cc 
<http://chart.cc>

index 86153a2..59311a9 100644
--- a/core/chart.cc <http://chart.cc>
+++ b/core/chart.cc <http://chart.cc>
@@ -20,8 +20,18 @@ void boot_time_chart::print_one_time(int index)
 void boot_time_chart::event(const char *str)
 {
-arrays[_event].str  = str;
-arrays[_event++].stamp = processor::ticks();
+event(_event++, str, processor::ticks());
+}
+
+void boot_time_chart::event(int event_idx, const char *str)
+{
+event(event_idx, str, processor::ticks());
+}
+
+void boot_time_chart::event(int event_idx, const char *str, u64 stamp)
+{
+arrays[event_idx].str = str;
+arrays[event_idx].stamp = stamp;
 }
 void boot_time_chart::print_chart()
diff --git a/include/osv/boot.hh b/include/osv/boot.hh
index eb97cc9..391ad8f 100644
--- a/include/osv/boot.hh
+++ b/include/osv/boot.hh
@@ -12,16 +12,17 @@ public:
 class boot_time_chart {
 public:
 void event(const char *str);
+void event(int event_idx, const char *str);
+void event(int event_idx, const char *str, u64 stamp);
 void print_chart();
-time_element arrays[16];
-friend void arch_setup_free_memory();
 private:
 // Can we keep it at 0 and let the initial two users increment 
it?  No, we
 // cannot. The reason is that the code that *parses* those 
fields run
 // relatively late (the code that takes the measure is so early 
it cannot
 // call this one directly. Therefore, the measurements would 
appear in the

 // middle of the list, and we want to preserve order.
-int _event = 2;
+int _event = 3;
+time_element arrays[16];
 void print_one_time(int index);
 double to_msec(u64 time);
diff --git a/loader.cc <http://loader.cc> b/loader.cc <http://loader.cc>
index f6cbd4d..de1d772 100644
--- a/loader.cc <http://loader.cc>
+++ b/loader.cc <http://loader.cc>
@@ -109,7 +109,8 @@ void premain()
 }
 setup_tls(inittab);
-boot_time.event("TLS initialization");
+debug("After TLS initialization");
+boot_time.event(2, "TLS initialization");
 for (auto init = inittab.start; init < inittab.start + 
inittab.count; ++init) {

 (*init)();
 }


Waldek


On Monday, April 9, 2018 at 8:17:11 AM UTC-4, Wang Yu wrote:

before patch boot with --bootchart, "TLS initialization"
is not output
...
disk read (real mode): 50.71ms, (+50.71ms)
.init functions: 89.20ms, (+5.48ms)
SMP launched: 90.56ms, (+1.36ms)
VFS initialized: 95.76ms, (+5.20ms)
...
after patch,
...
disk read (real mode): 50.71ms, (+50.71ms)
TLS initialization: 83.72ms, (+33.01ms)
    .init functions: 89.20ms, (+5.48ms)
SMP launched: 90.56ms, (+1.36ms)
VFS initialized: 95.76ms, (+5.20ms)
...
Signed-off-by: Wang Yu 
---
 include/osv/boot.hh | 4 ++--
loader.cc <http://loader.cc>   | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/osv/boot.hh b/include/osv/boot.hh
index eb97cc9..ec5301c 100644
--- a/include/osv/boot.hh
+++ b/include/osv/boot.hh
@@ -15,13 +15,13 @@ public:
 void print_chart();
 time_element arrays[16];
 friend void arch_setup_free_memory();
-private:
 // Can we keep it at 0 and let the initial two users
increment it?  No, we
 // cannot. The reason is that the code that *parses* those
fields run
 // relatively late (the code that takes the measure is so
early

Re: [PATCH] fix no output boot_time event "TLS initialization"

2018-04-11 Thread Wang Yu



在 18/4/12 上午10:22, Waldek Kozaczuk 写道:

Hi.

I reviewed this and other patch and replied on the the mailing list. Have my 
replies not reached you ?.
I haven't recieved it, maybe i am not in the mail list, and you re send 
reviewed  mail to me?


--
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [PATCH] add boot_time event of uncompress lzloader.elf

2018-04-11 Thread Wang Yu

pls review


在 18/4/9 下午8:46, Wang Yu 写道:

sometimes i found uncompres cost serival times,
so add boot_time event of uncompress lzloader.elf
after patch
...
disk read (real mode): 45.09ms, (+45.09ms)
uncompress lzloader.elf: 76.90ms, (+31.81ms)
TLS initialization: 77.65ms, (+0.75ms)
.init functions: 82.69ms, (+5.04ms)
SMP launched: 83.72ms, (+1.03ms)
VFS initialized: 88.67ms, (+4.95ms)
...
Signed-off-by: Wang Yu 
---
  arch/x64/arch-setup.cc | 5 +
  arch/x64/boot16.S  | 7 ++-
  include/osv/boot.hh| 2 +-
  loader.cc  | 2 +-
  4 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/arch/x64/arch-setup.cc b/arch/x64/arch-setup.cc
index 325c26a..ce81437 100644
--- a/arch/x64/arch-setup.cc
+++ b/arch/x64/arch-setup.cc
@@ -50,6 +50,7 @@ struct osv_multiboot_info_type {
  struct multiboot_info_type mb;
  u32 tsc_init, tsc_init_hi;
  u32 tsc_disk_done, tsc_disk_done_hi;
+u32 tsc_uncompress_done, tsc_uncompress_done_hi;
  u8 disk_err;
  } __attribute__((packed));
  
@@ -140,6 +141,10 @@ void arch_setup_free_memory()

  time = (time << 32) | omb.tsc_disk_done;
  boot_time.arrays[1] = { "disk read (real mode)", time };
  
+time = omb.tsc_uncompress_done_hi;

+time = (time << 32) | omb.tsc_uncompress_done;
+boot_time.arrays[2] = { "uncompress lzloader.elf", time };
+
  auto c = processor::cpuid(0x8000);
  if (c.a >= 0x8008) {
  c = processor::cpuid(0x8008);
diff --git a/arch/x64/boot16.S b/arch/x64/boot16.S
index d8808bd..d053a3f 100644
--- a/arch/x64/boot16.S
+++ b/arch/x64/boot16.S
@@ -20,7 +20,9 @@ mb_tsc1_lo = (mb_info + 88)
  mb_tsc1_hi = (mb_info + 88 + 4)
  mb_tsc_disk_lo = (mb_info + 88 + 8)
  mb_tsc_disk_hi = (mb_info + 88 + 12)
-mb_disk_err = (mb_info + 88 + 16)
+mb_uncompress_lo = (mb_info + 88 + 16)
+mb_uncompress_hi = (mb_info + 88 + 20)
+mb_disk_err = (mb_info + 88 + 24)
  mb_cmdline = (mb_info + 16)
  mb_mmap_len = (mb_info + 44)
  mb_mmap_addr = (mb_info + 48)
@@ -161,6 +163,9 @@ done_e820:
  mov %eax, %fs
  mov %eax, %ss
  call *lzentry
+rdtsc
+mov %eax, mb_uncompress_lo
+mov %edx, mb_uncompress_hi
  mov $loader, %eax
  mov $mb_info, %ebx
  call *entry
diff --git a/include/osv/boot.hh b/include/osv/boot.hh
index ec5301c..4c67410 100644
--- a/include/osv/boot.hh
+++ b/include/osv/boot.hh
@@ -20,7 +20,7 @@ public:
  // relatively late (the code that takes the measure is so early it cannot
  // call this one directly. Therefore, the measurements would appear in the
  // middle of the list, and we want to preserve order.
-int _event = 3;
+int _event = 4;
  private:
  
  void print_one_time(int index);

diff --git a/loader.cc b/loader.cc
index 0d97151..841e146 100644
--- a/loader.cc
+++ b/loader.cc
@@ -109,7 +109,7 @@ void premain()
  }
  
  setup_tls(inittab);

-boot_time._event=2;
+boot_time._event=3;
  boot_time.event("TLS initialization");
  for (auto init = inittab.start; init < inittab.start + inittab.count; 
++init) {
  (*init)();


--
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [PATCH] fix no output boot_time event "TLS initialization"

2018-04-11 Thread Wang Yu

no one review?


在 18/4/9 下午8:37, Wang Yu 写道:

before patch boot with --bootchart, "TLS initialization"
is not output
...
disk read (real mode): 50.71ms, (+50.71ms)
.init functions: 89.20ms, (+5.48ms)
SMP launched: 90.56ms, (+1.36ms)
VFS initialized: 95.76ms, (+5.20ms)
...
after patch,
...
disk read (real mode): 50.71ms, (+50.71ms)
TLS initialization: 83.72ms, (+33.01ms)
.init functions: 89.20ms, (+5.48ms)
SMP launched: 90.56ms, (+1.36ms)
VFS initialized: 95.76ms, (+5.20ms)
...
Signed-off-by: Wang Yu 
---
  include/osv/boot.hh | 4 ++--
  loader.cc   | 1 +
  2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/osv/boot.hh b/include/osv/boot.hh
index eb97cc9..ec5301c 100644
--- a/include/osv/boot.hh
+++ b/include/osv/boot.hh
@@ -15,13 +15,13 @@ public:
  void print_chart();
  time_element arrays[16];
  friend void arch_setup_free_memory();
-private:
  // Can we keep it at 0 and let the initial two users increment it?  No, we
  // cannot. The reason is that the code that *parses* those fields run
  // relatively late (the code that takes the measure is so early it cannot
  // call this one directly. Therefore, the measurements would appear in the
  // middle of the list, and we want to preserve order.
-int _event = 2;
+int _event = 3;
+private:
  
  void print_one_time(int index);

  double to_msec(u64 time);
diff --git a/loader.cc b/loader.cc
index f6cbd4d..0d97151 100644
--- a/loader.cc
+++ b/loader.cc
@@ -109,6 +109,7 @@ void premain()
  }
  
  setup_tls(inittab);

+boot_time._event=2;
  boot_time.event("TLS initialization");
  for (auto init = inittab.start; init < inittab.start + inittab.count; 
++init) {
  (*init)();


--
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH] add boot_time event of uncompress lzloader.elf

2018-04-09 Thread Wang Yu
sometimes i found uncompres cost serival times,
so add boot_time event of uncompress lzloader.elf
after patch
...
disk read (real mode): 45.09ms, (+45.09ms)
uncompress lzloader.elf: 76.90ms, (+31.81ms)
TLS initialization: 77.65ms, (+0.75ms)
.init functions: 82.69ms, (+5.04ms)
SMP launched: 83.72ms, (+1.03ms)
VFS initialized: 88.67ms, (+4.95ms)
...
Signed-off-by: Wang Yu 
---
 arch/x64/arch-setup.cc | 5 +
 arch/x64/boot16.S  | 7 ++-
 include/osv/boot.hh| 2 +-
 loader.cc  | 2 +-
 4 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/arch/x64/arch-setup.cc b/arch/x64/arch-setup.cc
index 325c26a..ce81437 100644
--- a/arch/x64/arch-setup.cc
+++ b/arch/x64/arch-setup.cc
@@ -50,6 +50,7 @@ struct osv_multiboot_info_type {
 struct multiboot_info_type mb;
 u32 tsc_init, tsc_init_hi;
 u32 tsc_disk_done, tsc_disk_done_hi;
+u32 tsc_uncompress_done, tsc_uncompress_done_hi;
 u8 disk_err;
 } __attribute__((packed));
 
@@ -140,6 +141,10 @@ void arch_setup_free_memory()
 time = (time << 32) | omb.tsc_disk_done;
 boot_time.arrays[1] = { "disk read (real mode)", time };
 
+time = omb.tsc_uncompress_done_hi;
+time = (time << 32) | omb.tsc_uncompress_done;
+boot_time.arrays[2] = { "uncompress lzloader.elf", time };
+
 auto c = processor::cpuid(0x8000);
 if (c.a >= 0x8008) {
 c = processor::cpuid(0x8008);
diff --git a/arch/x64/boot16.S b/arch/x64/boot16.S
index d8808bd..d053a3f 100644
--- a/arch/x64/boot16.S
+++ b/arch/x64/boot16.S
@@ -20,7 +20,9 @@ mb_tsc1_lo = (mb_info + 88)
 mb_tsc1_hi = (mb_info + 88 + 4)
 mb_tsc_disk_lo = (mb_info + 88 + 8)
 mb_tsc_disk_hi = (mb_info + 88 + 12)
-mb_disk_err = (mb_info + 88 + 16)
+mb_uncompress_lo = (mb_info + 88 + 16)
+mb_uncompress_hi = (mb_info + 88 + 20)
+mb_disk_err = (mb_info + 88 + 24)
 mb_cmdline = (mb_info + 16)
 mb_mmap_len = (mb_info + 44)
 mb_mmap_addr = (mb_info + 48)
@@ -161,6 +163,9 @@ done_e820:
 mov %eax, %fs
 mov %eax, %ss
 call *lzentry
+rdtsc
+mov %eax, mb_uncompress_lo
+mov %edx, mb_uncompress_hi
 mov $loader, %eax
 mov $mb_info, %ebx
 call *entry
diff --git a/include/osv/boot.hh b/include/osv/boot.hh
index ec5301c..4c67410 100644
--- a/include/osv/boot.hh
+++ b/include/osv/boot.hh
@@ -20,7 +20,7 @@ public:
 // relatively late (the code that takes the measure is so early it cannot
 // call this one directly. Therefore, the measurements would appear in the
 // middle of the list, and we want to preserve order.
-int _event = 3;
+int _event = 4;
 private:
 
 void print_one_time(int index);
diff --git a/loader.cc b/loader.cc
index 0d97151..841e146 100644
--- a/loader.cc
+++ b/loader.cc
@@ -109,7 +109,7 @@ void premain()
 }
 
 setup_tls(inittab);
-boot_time._event=2;
+boot_time._event=3;
 boot_time.event("TLS initialization");
 for (auto init = inittab.start; init < inittab.start + inittab.count; 
++init) {
 (*init)();
-- 
1.8.3.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH] fix no output boot_time event "TLS initialization"

2018-04-09 Thread Wang Yu
before patch boot with --bootchart, "TLS initialization"
is not output
...
disk read (real mode): 50.71ms, (+50.71ms)
.init functions: 89.20ms, (+5.48ms)
SMP launched: 90.56ms, (+1.36ms)
VFS initialized: 95.76ms, (+5.20ms)
...
after patch,
...
disk read (real mode): 50.71ms, (+50.71ms)
TLS initialization: 83.72ms, (+33.01ms)
.init functions: 89.20ms, (+5.48ms)
SMP launched: 90.56ms, (+1.36ms)
VFS initialized: 95.76ms, (+5.20ms)
...
Signed-off-by: Wang Yu 
---
 include/osv/boot.hh | 4 ++--
 loader.cc   | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/osv/boot.hh b/include/osv/boot.hh
index eb97cc9..ec5301c 100644
--- a/include/osv/boot.hh
+++ b/include/osv/boot.hh
@@ -15,13 +15,13 @@ public:
 void print_chart();
 time_element arrays[16];
 friend void arch_setup_free_memory();
-private:
 // Can we keep it at 0 and let the initial two users increment it?  No, we
 // cannot. The reason is that the code that *parses* those fields run
 // relatively late (the code that takes the measure is so early it cannot
 // call this one directly. Therefore, the measurements would appear in the
 // middle of the list, and we want to preserve order.
-int _event = 2;
+int _event = 3;
+private:
 
 void print_one_time(int index);
 double to_msec(u64 time);
diff --git a/loader.cc b/loader.cc
index f6cbd4d..0d97151 100644
--- a/loader.cc
+++ b/loader.cc
@@ -109,6 +109,7 @@ void premain()
 }
 
 setup_tls(inittab);
+boot_time._event=2;
 boot_time.event("TLS initialization");
 for (auto init = inittab.start; init < inittab.start + inittab.count; 
++init) {
 (*init)();
-- 
1.8.3.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[PATCH] fix no output boot_time event "TLS initialization"

2018-04-09 Thread Wang Yu
before patch boot with --bootchart, "TLS initialization"
is not output
...
disk read (real mode): 50.71ms, (+50.71ms)
.init functions: 89.20ms, (+5.48ms)
SMP launched: 90.56ms, (+1.36ms)
VFS initialized: 95.76ms, (+5.20ms)
...
after patch,
...
disk read (real mode): 50.71ms, (+50.71ms)
TLS initialization: 83.72ms, (+33.01ms)
.init functions: 89.20ms, (+5.48ms)
SMP launched: 90.56ms, (+1.36ms)
VFS initialized: 95.76ms, (+5.20ms)
...
Signed-off-by: Wang Yu 
---
 include/osv/boot.hh | 4 ++--
 loader.cc   | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/osv/boot.hh b/include/osv/boot.hh
index eb97cc9..ec5301c 100644
--- a/include/osv/boot.hh
+++ b/include/osv/boot.hh
@@ -15,13 +15,13 @@ public:
 void print_chart();
 time_element arrays[16];
 friend void arch_setup_free_memory();
-private:
 // Can we keep it at 0 and let the initial two users increment it?  No, we
 // cannot. The reason is that the code that *parses* those fields run
 // relatively late (the code that takes the measure is so early it cannot
 // call this one directly. Therefore, the measurements would appear in the
 // middle of the list, and we want to preserve order.
-int _event = 2;
+int _event = 3;
+private:
 
 void print_one_time(int index);
 double to_msec(u64 time);
diff --git a/loader.cc b/loader.cc
index f6cbd4d..0d97151 100644
--- a/loader.cc
+++ b/loader.cc
@@ -109,6 +109,7 @@ void premain()
 }
 
 setup_tls(inittab);
+boot_time._event=2;
 boot_time.event("TLS initialization");
 for (auto init = inittab.start; init < inittab.start + inittab.count; 
++init) {
 (*init)();
-- 
1.8.3.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


how to optimize startup time on osv

2018-01-19 Thread wang Yu
i have cut some nouse option, i.e. zfs
but the startup time about 110ms, i want to < 50ms, how to optimize it?

 OSv v0.24-479-g7ce5eb7

1 CPUs detected

Firmware vendor: Seabios

console=serial

bsd: initializing - done

VFS: mounting ramfs at /

VFS: mounting devfs at /dev

net: initializing - done

eth0: ethernet address: 52:54:00:12:34:56

virtio-blk: Add blk device instances 0 as vblk0, devsize=5996544

random: virtio-rng registered as a source.

eth0: 192.168.122.15

eth1: 192.168.122.16

Could not initialize network interface.

disk read (real mode): 45.88ms, (+45.88ms)

desire.init functions: 82.51ms, (+36.63ms)

.init functions: 82.51ms, (+0.00ms)

SMP launched: 84.81ms, (+2.30ms)

VFS initialized: 89.77ms, (+4.96ms)

Network initialized: 90.46ms, (+0.69ms)

drivers init: 90.58ms, (+0.12ms)

drivers 1: 90.58ms, (+0.00ms)

pvpanic done: 90.59ms, (+0.01ms)

pci enumerated: 99.97ms, (+9.38ms)

drivers probe: 99.97ms, (+0.00ms)

drivers 5: 109.87ms, (+9.90ms)

drivers 6: 109.87ms, (+0.00ms)

drivers 2: 109.87ms, (+0.00ms)

drivers 3: 109.91ms, (+0.04ms)

drivers 4: 109.91ms, (+0.00ms)

drivers loaded: 109.91ms, (+0.00ms)

ZFS mounted: 109.91ms, (+0.00ms)

Total time: 111.77ms, (+1.86ms)

hello world

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to download file/directory from httpserver?

2018-01-17 Thread wang Yu
2018-01-18 11:11 GMT+08:00 wang Yu :
> now i use curl -X POST http://192.168.122.89:8000/file/js.jar
> -Fname=@js.jar to upload the js.jar to osv "/"
>
> and i want to download/get js.jar, how i do?
> i try  curl -X GET http://192.168.122.89:8000/file/js.jar, but failed
curl  http://192.168.122.76:8000/file/js.jar?op=GET > js.jar can download file
how about directory?

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


how to download file/directory from httpserver?

2018-01-17 Thread wang Yu
now i use curl -X POST http://192.168.122.89:8000/file/js.jar
-Fname=@js.jar to upload the js.jar to osv "/"

and i want to download/get js.jar, how i do?
i try  curl -X GET http://192.168.122.89:8000/file/js.jar, but failed

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to run some .so or jar

2017-11-28 Thread wang Yu
2017-11-28 19:56 GMT+08:00 wang Yu :
> i am fresh man in osv, and i have a question about it;
> if we have some dyminic library .so, i want to how to run?
> for example, a.so have main enter, and it want to call the func_b()
> in b.so(we don't want to recompile it)
> a.c --->a.so
> extern void func_b(void)
> void main(void)
> {
>   ...
>func_b();
>...
> }
>
> b.c--->b.so
> void func_b(void)
> {
>   
> }
>
> i have edit  module.py  like this
>
> ```
> from osv.modules import api
>
> default = api.run('/a.so')
> 
> usr.manifest
> a.so:${MODULE_DIR}/a.so
> b.so:${MODULE_DIR}/b.so
>
> but when running, it can't look func_b()
>
> and i have the same question about server jar
> a.jar b.jar c.jar
> a.jar have the main, it depend on b.jar and c.jar
> i use like this cannot find b.jar and c.jar's function
> default = api.run("/java.so -jar a.jar ");

i know how to do in java,  api.run("/java.so -cp ./ -jar a.jar "); can do it;
but how i do in c/c++?

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


how to run some .so or jar

2017-11-28 Thread wang Yu
i am fresh man in osv, and i have a question about it;
if we have some dyminic library .so, i want to how to run?
for example, a.so have main enter, and it want to call the func_b()
in b.so(we don't want to recompile it)
a.c --->a.so
extern void func_b(void)
void main(void)
{
  ...
   func_b();
   ...
}

b.c--->b.so
void func_b(void)
{
  
}

i have edit  module.py  like this

```
from osv.modules import api

default = api.run('/a.so')

usr.manifest
a.so:${MODULE_DIR}/a.so
b.so:${MODULE_DIR}/b.so

but when running, it can't look func_b()

and i have the same question about server jar
a.jar b.jar c.jar
a.jar have the main, it depend on b.jar and c.jar
i use like this cannot find b.jar and c.jar's function
default = api.run("/java.so -jar a.jar ");

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.