From: Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>,
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
linux-kernel@vger.kernel.org, yrl.pp-manager.tt@hitachi.com
Subject: Re: [PATCH V2 4/5] trace-cmd: Add virt-server mode for a virtualization environment
Date: Tue, 22 Oct 2013 17:55:47 +0900 [thread overview]
Message-ID: <52663D93.1060507@hitachi.com> (raw)
In-Reply-To: <20131017223237.3acac97d@gandalf.local.home>
(2013/10/18 11:32), Steven Rostedt wrote:
> On Fri, 13 Sep 2013 11:06:37 +0900
> Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com> wrote:
>
>> static int *create_all_readers(int cpus, const char *node, const char *port,
>> - int pagesize, int fd)
>> + const char *domain, int virtpid, int pagesize, int fd)
>> {
>> char buf[BUFSIZ];
>> - int *port_array;
>> + int *port_array = NULL;
>> int *pid_array;
>> int start_port;
>> int udp_port;
>> int cpu;
>> int pid;
>>
>> - port_array = malloc_or_die(sizeof(int) * cpus);
>> + if (node) {
>> + port_array = malloc_or_die(sizeof(int) * cpus);
>> + start_port = START_PORT_SEARCH;
>> + }
>> pid_array = malloc_or_die(sizeof(int) * cpus);
>> memset(pid_array, 0, sizeof(int) * cpus);
>>
>> - start_port = START_PORT_SEARCH;
>> -
>> - /* Now create a UDP port for each CPU */
>> + /* Now create a reader for each CPU */
>> for (cpu = 0; cpu < cpus; cpu++) {
>> - udp_port = open_udp(node, port, &pid, cpu,
>> - pagesize, start_port);
>> - if (udp_port < 0)
>> - goto out_free;
>> - port_array[cpu] = udp_port;
>> + if (node) {
>> + udp_port = open_udp(node, port, &pid, cpu,
>> + pagesize, start_port);
>> + if (udp_port < 0)
>> + goto out_free;
>> + port_array[cpu] = udp_port;
>> + /*
>> + * due to some bugging finding ports,
>
> s/due/Due/
Thanks.
>> + * force search after last port
>> + */
>> + start_port = udp_port + 1;
>> + } else {
>> + if (open_virtio_serial_pipe(&pid, cpu, pagesize,
>> + domain, virtpid) < 0)
>> + goto out_free;
>> + }
>> pid_array[cpu] = pid;
>> /*
>> * Due to some bugging finding ports,
>
> Hmm, it seems that you added the start_port = udp_port + 1 above, but
> shouldn't you remove the one here?
Oh, you're right.
I'll delete it here.
>> @@ -482,7 +595,7 @@ static int *create_all_readers(int cpus, const char *node, const char *port,
>> return pid_array;
>>
>> out_free:
>> - destroy_all_readers(cpus, pid_array, node, port);
>> + destroy_all_readers(cpus, pid_array, node, port, domain, virtpid);
>> return NULL;
>> }
>>
>> @@ -524,7 +637,7 @@ static void stop_all_readers(int cpus, int *pid_array)
>> }
>>
>> static void put_together_file(int cpus, int ofd, const char *node,
>> - const char *port)
>> + const char *port, const char *domain, int virtpid)
>> {
>> char **temp_files;
>> int cpu;
>> @@ -533,25 +646,31 @@ static void put_together_file(int cpus, int ofd, const char *node,
>> temp_files = malloc_or_die(sizeof(*temp_files) * cpus);
>>
>> for (cpu = 0; cpu < cpus; cpu++)
>> - temp_files[cpu] = get_temp_file(node, port, cpu);
>> + temp_files[cpu] = get_temp_file(node, port, domain,
>> + virtpid, cpu);
>>
>> tracecmd_attach_cpu_data_fd(ofd, cpus, temp_files);
>> free(temp_files);
>> }
>>
>> -static void process_client(const char *node, const char *port, int fd)
>> +static void process_client(const char *node, const char *port,
>> + const char *domain, int virtpid, int fd)
>> {
>> int *pid_array;
>> int pagesize;
>> int cpus;
>> int ofd;
>>
>> - if (communicate_with_client(fd, &cpus, &pagesize) < 0)
>> - return;
>> -
>> - ofd = create_client_file(node, port);
>> + if (node) {
>> + if (communicate_with_client_nw(fd, &cpus, &pagesize) < 0)
>
> I take it _nw is for "network". If so, please use "*_net" instead. "nw"
> is pretty meaningless.
>
> This applies for all functions.
OK, I'll rename all functions using _nw.
Thanks,
Yoshihiro YUNOMAE
--
Yoshihiro YUNOMAE
Software Platform Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: yoshihiro.yunomae.ez@hitachi.com
next prev parent reply other threads:[~2013-10-22 8:55 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-13 2:06 [PATCH V2 0/5] trace-cmd: Support the feature recording trace data of guests on the host Yoshihiro YUNOMAE
2013-09-13 2:06 ` [PATCH V2 1/5] [CLEANUP] trace-cmd: Split out binding a port and fork reader from open_udp() Yoshihiro YUNOMAE
2013-09-13 2:06 ` [PATCH V2 2/5] trace-cmd: Apply the trace-msg protocol for communication between a server and clients Yoshihiro YUNOMAE
2013-10-15 2:21 ` Steven Rostedt
2013-10-17 6:34 ` Yoshihiro YUNOMAE
2013-10-17 21:21 ` Steven Rostedt
2013-10-18 2:19 ` Steven Rostedt
2013-10-22 8:53 ` Yoshihiro YUNOMAE
2013-09-13 2:06 ` [PATCH V2 3/5] trace-cmd: Use poll(2) to wait for a message Yoshihiro YUNOMAE
2013-09-13 2:06 ` [PATCH V2 4/5] trace-cmd: Add virt-server mode for a virtualization environment Yoshihiro YUNOMAE
2013-10-18 2:32 ` Steven Rostedt
2013-10-22 8:55 ` Yoshihiro YUNOMAE [this message]
2013-09-13 2:06 ` [PATCH V2 5/5] trace-cmd: Add --virt option for record mode Yoshihiro YUNOMAE
2013-10-11 1:39 ` [PATCH V2 0/5] trace-cmd: Support the feature recording trace data of guests on the host Yoshihiro YUNOMAE
2013-10-11 1:46 ` Steven Rostedt
2013-10-14 21:26 ` Steven Rostedt
2013-10-17 6:32 ` Yoshihiro YUNOMAE
2013-10-17 21:11 ` Steven Rostedt
2013-10-18 15:06 ` Steven Rostedt
2013-10-22 8:53 ` Yoshihiro YUNOMAE
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52663D93.1060507@hitachi.com \
--to=yoshihiro.yunomae.ez@hitachi.com \
--cc=hidehiro.kawai.ez@hitachi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=rostedt@goodmis.org \
--cc=yrl.pp-manager.tt@hitachi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox